I need the status code of my factory with promises, How can I do get it?
myApp.factory('cartService', ['$resource', function($resource){
return $resource('/api/v1/carts ', {}, {
show: { method: 'GET', isArray:false, headers:{'Authorization':'Token token=' + localStorage.Token} },
create: { method: 'POST', headers:{'Authorization':'Token token=' + localStorage.Token} }
})
}]);
This is the call
cartService.show().$promise.then(function(data){
$rootScope.cart = data;
// GET STATUS ????
}).catch(function(response){
growl.warning("Problems!!", {title: 'Error'});
})
The Response has status 204