Error in angular-js while using angular-local-storage

。_饼干妹妹 提交于 2019-12-13 05:18:27

问题


This code in AngularJS using angular-local-storage throws an error at the console :

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

}]);  

throws an error at the console :

Error: [$injector:unpr] Unknown provider: localStorageService Provider <- localStorageService <- MainCtrl http://errors.angularjs.org/1.4.7/$injector/unpr?p0=localStorageService%20Provider%20%3C-%20localStorageService%20%20%3C-%20MainCtrl at http://localhost:9000/bower_components/angular/angular.js:68:12 at http://localhost:9000/bower_components/angular/angular.js:4289:19 at Object.getService [as get] (http://localhost:9000/bower_components/angular/angular.js:4437:39) at http://localhost:9000/bower_components/angular/angular.js:4294:45 at getService (http://localhost:9000/bower_components/angular/angular.js:4437:39) at invoke (http://localhost:9000/bower_components/angular/angular.js:4469:13) at Object.instantiate (http://localhost:9000/bower_components/angular/angular.js:4486:27) at http://localhost:9000/bower_components/angular/angular.js:9151:28 at link (http://localhost:9000/bower_components/angular-route/angular-route.js:977:26) at invokeLinkFn (http://localhost:9000/bower_components/angular/angular.js:8789:9)

...but this runs perfectly fine!, may I know why?

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

});

来源:https://stackoverflow.com/questions/33350071/error-in-angular-js-while-using-angular-local-storage

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!