错误:无模块:ngRoute努力实现angularjs路由时, [英] Error: No module: ngRoute when trying to implement routing in angularjs

查看:257
本文介绍了错误:无模块:ngRoute努力实现angularjs路由时,的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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'
  });
}]);

我缺少的东西吗?谢谢!

Am I missing something? Thanks!

推荐答案

您已经包含了角route.js 文件在你的页面?和您使用的角度1.2.0 - 模块似乎并不在此之前存在的

Have you included the angular-route.js file in your page? And are you using angular 1.2.0 - the module doesn't seem to exist prior to this.

请参阅 http://docs.angularjs.org/api/ngRoute

这篇关于错误:无模块:ngRoute努力实现angularjs路由时,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆