Error: No module: ngRoute when trying to implement routing in angularjs

natecraft1 picture natecraft1 · Oct 17, 2013 · Viewed 28.7k times · Source
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!

Answer

Andyrooger picture Andyrooger · Oct 17, 2013

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.

See http://docs.angularjs.org/api/ngRoute