How to IF NOT inside of {{ #each }} template

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-04 15:18:32

问题


How can I render this Meteor Blaze Template ? I would like to use the negative of the IF, but I don't find anywhere how to use it.

<ul>
{{#each pages}}
  {{#if (--NOT--) isCover }}
    <li> some content {{value}} </li>
  {{/if}}
{{/each}}
</ul>

Previous research not found solution https://github.com/meteor/meteor/wiki/Using-Blaze Check for equality in Spacebars?

Note: if I use only the if statement is working without problem, also I could do and else but I would like to have it only with the if(!isCover) solution


回答1:


You need to use the {{#unless}} block helper.

http://blazejs.org/

{{#unless isCover}}
  <li> some content {{value}} </li>
{{/unless}}


来源:https://stackoverflow.com/questions/27182490/how-to-if-not-inside-of-each-template

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!