app = angular.module("dithat", ["ngRoute", "ngResource", 'ng-rails-csrf']);
app.config(['$routeProvider',
function($routeProvider) {
$routeProvider.
when('/', {
templateUrl: 'app/views/layouts/_user_page.html',
controller: 'accomplishmentController'
});
}]);
我错过了什么吗?谢谢!
答案 0 :(得分:26)
您是否在网页中加入了angular-route.js
文件?你使用角度1.2.0 - 在此之前模块似乎不存在。
答案 1 :(得分:2)
将angular-route
添加到application.js中,例如
在/app/assets/javascripts/application.js
//= require angular
//= require angular-resource
//= require angular-route
答案 2 :(得分:-1)
从我们的依赖注入中删除ngRoute,因为您已在config
中注入routeProviderapp = angular.module("dithat", ["ngResource", 'ng-rails-csrf']);
app.config(['$routeProvider',
function($routeProvider) {
$routeProvider.
when('/', {
templateUrl: 'app/views/layouts/_user_page.html',
controller: 'accomplishmentController'
});
}]);