2012-12-13 31 views
0

可能重复:
Logical operator in a handlebars.js {{#if}} conditional如何使用Ember Handlebars帮手?

这里是我的代码

{{#each dataArray}} 
    <li>{{#isTrue idVal1 idVal2}} 
    show some text1 
{{else}} 
    show some text2 
{{/isTrue}} 
    </li> 
{{/each}} 

Em.Handlebars.registerHelper('isTrue', function(x, y) { 
    console.log(x);// shows idVal1 
    console.log(y);// shows idVal2 not the exact value, I have passed 
    return x==y; 
}); 

预期成果: - 它应该返回真/假

+0

请参阅https://guides.emberjs.com/v2.12.0/tutorial/hbs-helper/ – core114

回答

0

这是不可能编写出界帮手,问题#1274

我想知道为什么这个有用的拉请求仍然悬而未决。 有一个workaround