I'm developing using mostly Chrome. I just discovered a bug, where the following snippet was working fine in Chrome, but not in Firefox.
Template.myTemplate.events({
"click input[type=checkbox]"(){
let context = event.target.dataset.context;
InspireTheWorldWith.call({context});
}
});
I could not quite believe my eyes, but essentially the variable 'event' was never assigned in the parameters of the event function. Yet this worked in Chrome without any issues. For the record, it clearly should be:
Template.myTemplate.events({
"click input[type=checkbox]"(event, template){
let context = event.target.dataset.context;
InspireTheWorldWith.call({context});
}
});
I'd like to read up more about this to really understand what is going on, but I'm struggling to find the approrpate 'keyword' to google. for.
Any suggestions?
For the record, I'm using Meteor 1.4, babel-runtime@6.18