如何使Handlebars帮助器知道Ember绑定? [英] How do you make a Handlebars helper that is aware of Ember bindings?
本文介绍了如何使Handlebars帮助器知道Ember绑定?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我尝试将Ember绑定或计算属性传递给自定义Handlebars帮助器时,帮助程序将接收字符串而不是该值。如何获得帮助者的价值?
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?
模板:
{{my_helper my.binding}}
帮助者收到my.binding而不是
The helper receives "my.binding" instead of the corresponding value.
推荐答案
前几天,一个推高手解决了问题:
使用Ember.Handlebars.registerBoundHelper。
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);
}
);
这篇关于如何使Handlebars帮助器知道Ember绑定?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文