Sha256: fc6e402f21a7585c81183d0e37fe4e1dcbf2e0c23897a4bd738c2c139436f0f3
Contents?: true
Size: 721 Bytes
Versions: 30
Compression:
Stored size: 721 Bytes
Contents
angular.module("oxymoron.services.interceptor", []) .factory('httpInterceptor', ['$q', '$rootScope', '$log', function ($q, $rootScope, $log) { return { request: function (config) { $rootScope.$broadcast('loading:progress'); return config || $q.when(config); }, response: function (response) { $rootScope.$broadcast('loading:finish', response); return response || $q.when(response); }, responseError: function (response) { $rootScope.$broadcast('loading:error', response); return $q.reject(response); } }; }]) .config(['$httpProvider', function ($httpProvider) { $httpProvider.interceptors.push('httpInterceptor'); }])
Version data entries
30 entries across 30 versions & 1 rubygems