0

AngularJS 中使用angular-local-storage的这段代码在控制台抛出错误:

angular.module('myTodoApp').controller('MainCtrl', ['$scope', 'localStorageService ', function($scope, localStorageService) {  

}]);  

在控制台抛出错误:

错误:[$injector:unpr] 未知提供者:localStorageService 提供者 <- localStorageService <- MainCtrl http://errors.angularjs.org/1.4.7/ $injector/unpr?p0=localStorageService%20Provider%20%3C-%20localStorageService %20%20%3C-%20MainCtrl 在http://localhost:9000/bower_components/angular/angular.js:68:12http://localhost:9000/bower_components/angular/angular.js:4289:19 在Object.getService [as get] ( http://localhost:9000/bower_components/angular/angular.js:4437:39 ) 在http://localhost:9000/bower_components/angular/angular.js:4294:45 在 getService (http://localhost:9000/bower_components/angular/angular.js:4437:39)在调用(http://localhost:9000/bower_components/angular/angular.js:4469:13 ) 在 Object.instantiate ( http://localhost:9000/bower_components/angular/angular.js:4486:27 ) 在http:// localhost:9000/bower_components/angular/angular.js:9151:28 在链接 ( http://localhost:9000/bower_components/angular-route/angular-route.js:977:26 ) 在 invokeLinkFn ( http://localhost :9000/bower_components/angular/angular.js:8789:9 )

...但这运行得很好!,我可以知道为什么吗?

angular.module('myTodoApp').controller('MainCtrl', function($scope, localStorageService) {

});
4

0 回答 0