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

后端 未结 3 480
无人及你
无人及你 2021-01-11 10:48
app = angular.module(\"dithat\", [\"ngRoute\", \"ngResource\", \'ng-rails-csrf\']);
  app.config([\'$routeProvider\',
  function($routeProvider) {
  $routeProvider.
         


        
3条回答
  •  孤独总比滥情好
    2021-01-11 11:35

    Remove ngRoute from our dependency injection as you are already injecting routeProvider in config

    app = angular.module("dithat", ["ngResource", 'ng-rails-csrf']);
      app.config(['$routeProvider',
      function($routeProvider) {
      $routeProvider.
      when('/', {
      templateUrl: 'app/views/layouts/_user_page.html',
      controller: 'accomplishmentController'
    });
    }]);
    

提交回复
热议问题