我有下一个配置(index.js)来调用我的拦截器工厂。
angular.module('pasApp')
.factory('InterceptorFactory',['$q','$location',require('./factory-interceptor.js')])
.config(['$stateProvider','$urlRouterProvider', '$httpProvider','InterceptorFactory',require('./config-app.js')])
.run(['$ionicPlatform','$rootScope','$window','StorageFactory','$state','$timeout','$http',require('./run-app.js')]);
我的文件夹和文件顺序:
>config
>config-app.js
>factory-interceptor.js
>index.js
>run-app.js
当我从 './factory-inteceptor.js' 调用我的“InterceptorFactory”函数时,我的控制台出现下一个错误:
Uncaught Error: [$injector:modulerr] Failed to instantiate module pasApp due to:
Error: [$injector:unpr] Unknown provider: InterceptorFactory
http://errors.angularjs.org/1.4.3/$injector/unpr?p0=InterceptorFactory
at http://localhost:8100/js/app.bundle.js:9874:12
at http://localhost:8100/js/app.bundle.js:14068:19
at getService (http://localhost:8100/js/app.bundle.js:14215:39)
at Object.invoke (http://localhost:8100/js/app.bundle.js:14247:13)
at runInvokeQueue (http://localhost:8100/js/app.bundle.js:14162:35)
at http://localhost:8100/js/app.bundle.js:14171:11
at forEach (http://localhost:8100/js/app.bundle.js:10142:20)
at loadModules (http://localhost:8100/js/app.bundle.js:14152:5)
at createInjector (http://localhost:8100/js/app.bundle.js:14078:11)
at doBootstrap (http://localhost:8100/js/app.bundle.js:11436:20)
http://errors.angularjs.org/1.4.3/$injector/modulerr?p0=pasApp&p1=Error%3A%…otstrap%20(http%3A%2F%2Flocalhost%3A8100%2Fjs%2Fapp.bundle.js%3A11436%3A20)