Skip to content Skip to sidebar Skip to footer

Helper Broken In Ember 1.10

I was using custom Handlebars helper extending the functionality of 'if' block. In Ember 1.10 this doesnt work anymore as there is no Ember.Handlebars.bind property which allowed b

Solution 1:

I actually managed to find a way to do it, so I'll write the answer for my own question...

Instead of using undocumented hacks, I used the proposed change: https://github.com/emberjs/ember.js/issues/10295

So my helper looks like this now:

Ember.Handlebars.registerBoundHelper('isSame', function(value1, value2) {
    return value1 === value2
});

and the usage:

{{#if (isSame property "value")}}
    {{some-other-component}}
{{elseif (isSame property "otherValue"}}
    something other...
{{else}}
    something other...
{{/if}}

Post a Comment for "Helper Broken In Ember 1.10"