Just use "transformResponse"
return $resource('http://jsonplaceholder.typicode.com/users/:user',user:'@user',{
query: {
method: 'GET',
transformResponse: function (data, headers, status) {
var ret = {data: data, status: status};
return ret;
}}
});
You will receive data in {data} key and "Status Code" (for example, 200 500 403) in {status} key
source
share