javascript - Context change events won't work Meteor -
so i've got structure
<template name="example"> {{#each post}} <div class="hello"></div> {{/each}} </template> so trying check click events on hello div
template.example.events = { 'click .hello' : function(event) { console.log("hey"); } } but not working. console not logging anything.
does have change of context in html template?
events function need pass event map to. right assigning event map , overriding actual events method. try this:
template.example.events({ 'click .hello' : function(event) { console.log("hey"); } });
Comments
Post a Comment