splitify
Version:
Splitify is a way to save your time when sharing the restaurant bill with someone
16 lines (15 loc) • 398 B
JavaScript
Template.restaurantView.helpers({
restaurant: function(){
var id = Router.current().params._id;
var item = Restaurants.findOne({_id:id});
return item;
}
});
Template.restaurantView.events({
'click #restaurant-delete-btn': function(event) {
event.preventDefault();
var id = Router.current().params._id;
Restaurants.remove(id);
Router.go('restaurant.list');
}
});