AngularJS Error: $injector:unpr Unknown Provider

后端 未结 13 947
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-13 08:10

I\'m trying to build my own service by following the example in the documentation for the factory methodology. I think I\'ve done something wrong however because I continue

13条回答
  •  一个人的身影
    2020-12-13 09:11

    I was getting this problem and it turned out I had included my controller both in ui.router and in the html template as in

    .config(['$stateProvider',
      function($stateProvider) {
        $stateProvider.state('dashboard', {
          url: '/dashboard',
          templateUrl: 'dashboard/views/index.html',
          controller: 'DashboardController'
        });
      }
    ]);
    

    and

提交回复
热议问题