I'm enjoying a nice chicken and egg problem with dependancy injection in angular, I override $exceptionHandler by injecting $http, but I also have a custom interceptor.
Uncaught Error: [$injector:unpr] Unknown provider: $httpProvider <- $http <- $exceptionHandler <- $rootScope
I am trying to use it like so:
Module.config(['$httpProvider', function($httpProvider) {
$httpProvider.interceptors.push('special-http');
}]);
I wrapped my interceptor in a factory:
Module.factory('special-http', ['$templateCache', function($templateCache) {
"use strict";
return {
'request': function(config) {
if ($templateCache.get(config.url)){
return config;
}
//some logic
return config;
}
}
}]);
exceptionHandler.js
Module.factory('$exceptionHandler', [' $http', function ($http) {
"use strict";
//code
}