1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | 1 1 1 | (function() { 'use strict'; function httpInterceptor($q, $log) { return { request: function(config) { return config; }, requestError: function(rejection) { $log.debug(rejection); return $q.reject(rejection); }, response: function(response) { $log.debug('response: ', response); return response; }, responseError: function(rejection) { $log.debug(rejection); return $q.reject(rejection); } }; } angular.module('common.interceptors.http', []) .factory('httpInterceptor', httpInterceptor); })(); |