I am new to AngularJs and I am trying to really wrap my mind on how to use $resource to get the HTTP status code that was passed back I have this factory I have setup with one way I have tried to implement getting the HTTP header with no success.
app.js
.factory("Resource", function ($resource, baseUrl) {
return $resource(baseUrl + "rest/sessionId",
{},
{getSessionId: {method: "GET"}},
get:
{
method: 'GET'
interceptor: {
response: function (response) {
var result = response.resource;
result.$status = response.status;
return result;
}
}
}
);
})