In Angular, I would like to have a function that intercepts the $resource response before it gets to the controller to see if it has an error flag set and then act on that error flag. Is there a resource function I can hook into to check the response data before it sends it on it's way to the controller?
Sample resource :
mymod.factory('setSomething', function($resource){
var resource = $resource('/proxy/request.php?action=setSomething', {}, {
post:{
method : "POST",
isArray : false,
headers : {
'Content-Type':'application/x-www-form-urlencoded; charset=UTF-8'
}
},
});
return resource;
});