Does anyone know how you can check to see that a resource failed to be fetched in AngularJS?
For example:
//this is valid syntax
$scope.word = Word.g
An additional callback function after your first callback function should fire when there is an error. Taken from the docs and group post:
$scope.word = Word.get({ id : $routeParams.id }, function() {
//good code
}, function(response) {
//404 or bad
if(response.status === 404) {
}
});
- HTTP GET "class" actions: Resource.action([parameters], [success], [error])
- non-GET "class" actions: Resource.action([parameters], postData, [success], [error])
- non-GET instance actions: instance.$action([parameters], [success], [error])