Commit 006fbfaa authored by Tomotsugu Kaneko's avatar Tomotsugu Kaneko

fixes #617 - added Meteor.methods

To call the `remove` method on the server side from the client side.
parent eb2d7cbb
......@@ -191,7 +191,13 @@ if (Meteor.is_client) {
// Register click events for clearing completed todos
Template.footer.events = {
'click button#clear-completed': function() {
Todos.remove({completed: true});
Meteor.call('clearCompleted');
}
};
}
Meteor.methods({
clearCompleted: function () {
Todos.remove({completed: true});
}
});
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment