AngularJS: Wie gehe ich mit ngResource mit Rückrufen nach Erfolg und Fehlern um?
Dasdocs gibt keine Ahnung davon.
MeineREST
enpoint kann einen Fehler auslösen
$scope.delete = function(index) {
Transaction.delete({transactionId: $scope.transactions[index].uuid})
};
Ich habe das obige in folgendes geändert
$scope.delete = function(index) {
Transaction.delete({transactionId: $scope.transactions[index].uuid})
.success('transaction deleted');
};
Aber es schlägt fehl
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
Wie kann ich damit umgehen?success
underror
Szenarien?
P.S. Ich bin neu in JavaScript