Advertisement
Guest User

Untitled

a guest
Oct 16th, 2017
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. vm.deleteTrip = function (trip) {
  2. vm.isBusy = true;
  3. vm.errorMessage = "";
  4. var tripToDelete = trip;
  5.  
  6. $http.delete("/api/trips")
  7. .then(function (response) {
  8. //if succeed
  9. vm.trips.splice(tripToDelete, 1);
  10. }, function () {
  11. //if failed
  12. vm.errorMessage = "Failed to delete Trip";
  13. })
  14. .finally(function () {
  15. vm.isBusy = false;
  16. });
  17. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement