The docs does not give any idea about it.
My REST
enpoint might throw error
$scope.delete = function(index) {
Transaction.delete({transactionId: $scope.transactions[index].uuid})
};
I changed the above to following
$scope.delete = function(index) {
Transaction.delete({transactionId: $scope.transactions[index].uuid})
.success('transaction deleted');
};
But it fails
TypeError: Object #<Resource> has no method 'success'
at Object.TransactionController.$scope.delete (http://localhost:5000/static/app/js/controllers/transactionController.js:26:8)
at http://localhost:5000/static/app/lib/angular/angular.js:6094:36
How can I handle success
and error
scenarios?
P.S. I am new to JavaScript