Skip to content

Instantly share code, notes, and snippets.

@mekhami
Created December 8, 2015 23:11
Show Gist options
  • Select an option

  • Save mekhami/ef453ef08faba6e75691 to your computer and use it in GitHub Desktop.

Select an option

Save mekhami/ef453ef08faba6e75691 to your computer and use it in GitHub Desktop.
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