5
votes

When I try to pass an Ember binding or computed property to a custom Handlebars helper, the helper receives the string instead of the value. How do I get the value into the helper?

The template:

{{my_helper my.binding}}

The helper receives "my.binding" instead of the corresponding value.

2

2 Answers

6
votes

A few days ago a push on the master solved the problem : use Ember.Handlebars.registerBoundHelper.

Ember.Handlebars.registerBoundHelper('myHelper', 
    function(myBinding, options) {
        return myDealWith(myBinding);
    }
);
4
votes

You have to use Ember.getPath to get the value in helper method.
See the docs http://emberjs.com/documentation/#toc_writing-custom-helpers