Skip to content

Instantly share code, notes, and snippets.

@stephentcannon
Created February 17, 2014 00:52
Show Gist options
  • Save stephentcannon/9042875 to your computer and use it in GitHub Desktop.
Save stephentcannon/9042875 to your computer and use it in GitHub Desktop.
a meteor pattern for a generic event handler
<body>
{{> eventhandler}}
</body>
<template name="eventhandler">
{{> template1 }}
{{> template2 }}
{{> template3 }}
</template>
Template.template1.events({
// will fire first
// stopPropagation to prevent bubbling in this template
// stopImmediatePropagation to prevent bubbling to parent templates
})
Template.eventHandler.events({
// will fire last
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment