admin管理员组

文章数量:1415664

I pass a variable with the content 0 or 1 to the template.

I would like something to be output if the value is 0 (false) and something else to be output if the value is 1 (true).

I tried the following:

{{#schuelerdaten}}
  {{#genehmigt}}Ist genehmigt{{/genehmigt}}
  {{^genehmigt}}Ist nicht genehmigt{{/genehmigt}}
{{/schuelerdaten}}

and

{{#schuelerdaten.genehmigt}}
    Ist genehmigt.
{{/schuelerdaten.genehmigt}}

The message "Ist nicht genehmigt" always appears when there is a 1 or a 0 in the database.

本文标签: mustacheConditional rendering always shows same message despite variable being 0 or 1Stack Overflow