我正在學習如何使用angularjs路由和模板,並且遇到了問題。我在Gemfile中添加創業板,添加// =需要的application.js角度護欄模板,並在我的主要angular.module角度路由和模板問題
angular.module('authentication', ['authenticationModule','ngRoute','templates'])
.config(['$routeProvider',function($provider){
$provider
.when('/sign_in', { templateUrl: '/assets/signin.html', controller: 'redirectCtrl'})
.when('/sign_up', { templateUrl: 'templates/signup.html.erb', controller: 'redirectCtrl1'})
.controller('redirectCtrl', function($location) {
$location.path('/sign_in')
})
.controller('redirectCtrl1', function($location) {
$location.path('/sign_up')
})
我signin.html位於/資產增加了扶養/模板/ signin.html 當我嘗試加載頁面時,我沒有得到呈現頁面,但我得到這個
window.AngularRailsTemplates || (window.AngularRailsTemplates = angular.module(「templates」,[])); window.AngularRailsTemplates.run([「$ templateCache」,function($ templateCache){$ templateCache.put(「signin.html」,「\ u003cdiv ng-controller = \」authenticationCtrl \「\ u003e \ n \ t \ u003cdiv \ u003e \ n \ t \ u003c \ div \ u003e \ n \ t \ u003c \ h00 \ u003e \ n \ t \ u003c \ h00 \ u003e \ n \ t \ u003cdiv \ u003e \ n \ t \ t \ u003c \密碼:\ u003cinput類型= \「密碼\ u003cdiv \ u003e電子郵件:\ u003cinput模型= \」電子郵件\「類型= \」電子郵件\「/ \ u003e \ u003c/div \ u003e \ 「ng-model = \」password \「/ \ u003e \ u003c/div \ u003e \ n \ n \ t \ t \ u003cbutton ng-click = \」login()\「\ u003eLogin \ u003c/button \ u003e \ n \ t \ t \ u003c/div \ u003e \ n \ t \ u003c/div \ u003e \ t \ t \ t \ n \ u003c/div \ u003e \ n「);}]);
我的問題的任何解決方案? 在此先感謝
更新1: 好了,我已經改變了下面的東西,
angular.module('authentication', ['authenticationModule','ngRoute','templates'])
.config(['$routeProvider',function($provider){
$provider
.when('/sign_in', { templateUrl: 'assets/signin.html', controller: 'redirectCtrl'})
.when('/sign_up', { templateUrl: 'assets/signup.html', controller: 'redirectCtrl1'})
}])
.controller('redirectCtrl', function($location) {
// $location.path('/sign_in')
})
.controller('redirectCtrl1', function($location) {
// $location.path('/sign_up')
})
這裏是我現在得到的模板加載,但一些額外的東西,我不需要 http://postimg.org/image/iuhy9dflj/