I like the problem with chicken and egg with dependency injection in angular, I override $ exceptionHandler by entering $ 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 this:
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; }
exceptionHandler.js
Module.factory('$exceptionHandler', [' $http', function ($http) { "use strict";
angularjs
FutuToad Mar 27 '14 at 9:56 a.m. 2014-03-27 09:56
source share