From 006fbfaa0aea19a67f9002041f6bb7d5857cde1b Mon Sep 17 00:00:00 2001 From: Tomotsugu Kaneko Date: Fri, 28 Jun 2013 17:44:28 +0900 Subject: [PATCH] fixes #617 - added Meteor.methods To call the `remove` method on the server side from the client side. --- labs/architecture-examples/meteor/app.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/labs/architecture-examples/meteor/app.js b/labs/architecture-examples/meteor/app.js index 5d7081994e..e131bebcab 100644 --- a/labs/architecture-examples/meteor/app.js +++ b/labs/architecture-examples/meteor/app.js @@ -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