Interceptor - httpProvider
Angular JS
by manoj_antony32
HTML
<div ng-controller="myCtrl"></div>
JavaScript
var myApp = angular.module('myApp', []);
myApp.config(['$httpProvider', function($httpProvider){
$httpProvider.interceptors.push('httpRespHandler');
}]);
myApp.factory('httpRespHandler', function($q){
return {
response: function(response){
console.log(response)
}
}
});
myApp.controller('myCtrl', function($scope, $http){
$http.get('https://api.github.com/users/naorye/repos').
success(function(){
});
});