mustache - Conditional rendering always shows same message despite variable being 0 or 1 - Stack Overflow

I pass a variable with the content 0 or 1 to the template.I would like something to be output if the v

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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745212349a4616918.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信