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