Created
December 8, 2015 23:11
-
-
Save mekhami/ef453ef08faba6e75691 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function RsvpDetailController ($scope, $routeParams, $location, rsvpDS) { | |
| $scope.rsvp = {}; | |
| $scope.status; | |
| getRsvp(); | |
| function getRsvp() { | |
| rsvpDS.getRsvpById($routeParams.id) | |
| .success(function(rsvp) { | |
| angular.merge($scope.rsvp, rsvp); | |
| }) | |
| .error(function(data) { | |
| $scope.status = data; | |
| }) | |
| } | |
| $scope.deleteRsvp = function() { | |
| rsvpDS.deleteRsvp($scope.rsvp._id) | |
| .then(function() { | |
| console.log('success'); | |
| $location.path('/admin'); | |
| }) | |
| .catch(function(err) { | |
| console.log(err); | |
| }); | |
| }; | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment