Blaze data context difference between Meteor 1.5 vs 1.6


#1

I used to work with Blaze with codes like this

view.jade

template(name='something')
    table
        each val in datas
            tr: td#row= val

client.coffee

Template.something.helpers
    datas: -> [
        name: 'foo', age: 33
    ,
        name: 'bar', age: 42
    ]
Template.something.events
    'click #row': -> console.log this

When we click the table row, this is what happened

  • on Meteor 1.5 it returns an object {name: 'foo', age: 33}
  • on Meteor 1.6 it returns an empty object {}

Is this feature change/removed on purpose? If yes, how else can I get data from the element?


#2

This should definitely not be happening as a result of an upgrade. I’ve upgraded several blaze apps with helpers exactly like yours without issue.

My suspicion is that it’s something to do with coffeescript. Have you tried to reproduce with vanillaJS?