How to implement not with if statement in Ember Handlebars?

后端 未结 6 1679
故里飘歌
故里飘歌 2021-01-30 04:34

I have a statement like this:

{{#if IsValid}}

I want to know how I can use a negative if statement that would look like that:

6条回答
  •  被撕碎了的回忆
    2021-01-30 05:34

    it can be done in multiple ways.

    1 use unless

    {{#unless IsValid}}
    
    {{/unless}}
    

    2.use if else

    {{#if IsValid}}
    {{else}}
    
    {{/if}}
    

    3.use not helper

    {{#if (not IsValid)}}
    
    {{/if}}
    

提交回复
热议问题