Tutorial

Template Event Maps in Meteor

While this tutorial has content that we believe is of great benefit to our community, we have not yet tested or edited it to ensure you have an error-free learning experience. It's on our list, and we're working on it! You can help us out by using the "report an issue" button at the bottom of the tutorial.

With Meteor you deal with event handling using event maps. Here’s a snippet to define an event map scoped to a template.

Template.myTemplate.events({
  'click #myEl': function(evt, tpl) {
    evt.preventDefault();
    // do stuff
  }
});
Creative Commons License