Ember.js 使用内联;“如果帮助者”;在余烬中使用逻辑运算符

Ember.js 使用内联;“如果帮助者”;在余烬中使用逻辑运算符,ember.js,handlebars.js,Ember.js,Handlebars.js,所以基本上,我只想添加classactive,如果index等于0 {{#each posts as |post index|}} <div class="item {{ 'add active class here if index is 0' }}"> </div> {{/each}} {{{#每个帖子作为|帖子索引} {{/每个}} 我知道使用此代码,{{if index==0'active'}}将无法工作,因为ember中内置的if helper不支持

所以基本上,我只想添加classactive,如果index等于0

{{#each posts as |post index|}}
  <div class="item {{ 'add active class here if index is 0' }}">
  </div>
{{/each}}
{{{#每个帖子作为|帖子索引}
{{/每个}}
我知道使用此代码,
{{if index==0'active'}}
将无法工作,因为ember中内置的if helper不支持逻辑运算符

那么实现这一点的方法是什么呢?

看看插件


也适用于数学运算。

这是我需要的。谢谢。