
Untitled
By: a guest on
Aug 10th, 2012 | syntax:
None | size: 0.65 KB | hits: 7 | expires: Never
AngularJS Failed Resource GET
//this is valid syntax
$scope.word = Word.get({ id : $routeParams.id },function() {
//this is valid, but won't be fired if the HTTP response is 404 or any other http-error code
});
//this is something along the lines of what I what I want to have (NOT THIS IS INVALID AND DOESN'T EXIST)
$scope.word = Word.get({ id : $routeParams.id },{
success : function() {
//good
},
failure : function() {
//404 or bad
}
});
$scope.word = Word.get({ id : $routeParams.id },function() {
//good code
}, function(response, getResponseHeaders) {
//404 or bad
if(response.status === 404){
}
});