Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- vm.deleteTrip = function (trip) {
- vm.isBusy = true;
- vm.errorMessage = "";
- var tripToDelete = trip;
- $http.delete("/api/trips")
- .then(function (response) {
- //if succeed
- vm.trips.splice(tripToDelete, 1);
- }, function () {
- //if failed
- vm.errorMessage = "Failed to delete Trip";
- })
- .finally(function () {
- vm.isBusy = false;
- });
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement