javascript - Why the interceptor factory is failing when is request in the config file? -
i have next configuration (index.js) call interceptor factory.
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')]);
my folder , files order:
>config >config-app.js >factory-interceptor.js >index.js >run-app.js
when call "interceptorfactory" function './factory-inteceptor.js', console presents next error:
uncaught error: [$injector:modulerr] failed instantiate module pasapp due to: error: [$injector:unpr] unknown provider: interceptorfactory http://errors.angularjs.org/1.4.3/$injector/unpr?p0=interceptorfactory @ http://localhost:8100/js/app.bundle.js:9874:12 @ http://localhost:8100/js/app.bundle.js:14068:19 @ getservice (http://localhost:8100/js/app.bundle.js:14215:39) @ object.invoke (http://localhost:8100/js/app.bundle.js:14247:13) @ runinvokequeue (http://localhost:8100/js/app.bundle.js:14162:35) @ http://localhost:8100/js/app.bundle.js:14171:11 @ foreach (http://localhost:8100/js/app.bundle.js:10142:20) @ loadmodules (http://localhost:8100/js/app.bundle.js:14152:5) @ createinjector (http://localhost:8100/js/app.bundle.js:14078:11) @ 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)
make sure factory-interceptor.js
exporting function factory registered.
Comments
Post a Comment