我怎样才能使用Ember Handlebars助手?

时间:2012-12-13 15:28:32

标签: javascript html ember.js handlebars.js

  

可能重复:
  Logical operator in a handlebars.js {{#if}} conditional

这是我的代码

{{#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;
 });

预期结果: - 它应该返回true / false

1 个答案:

答案 0 :(得分:0)

编写绑定帮助程序是不可能的,发出#1274

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

相关问题