Reputation: 578
Does exist a way to consult the value of object config inside a interceptor? I want to view the config values before and after every request.
In the following code, how can I print the entire structure of config and response object in their respective case?
$provide.factory('myHttpInterceptor', function() {
return {
// optional method
'request': function(config) {
// do something on success
return config;
}
'response': function(response) {
// do something on success
return response;
}
};
});
Upvotes: 0
Views: 86
Reputation: 286
You can simply print the config and response object using :
console.log("config : "+ angular.toJson(config));
console.log("response : "+ angular.toJson(response));
Upvotes: 1