我有下一個配置(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
當我打電話給我的 「InterceptorFactory」 功能從」 ./factory-inteceptor.js',我的控制檯呈現出下一個錯誤:
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)