Render "0" value using a mustache template
javascript, mustache, templates, web-applications, zero
Solution
@bobthecow answered it in his comment:
It won't display a zero because zero is falsey. One option to get it to display is to set it to a non-falsey value (like the string '0')
Problem
I have a model with a attribute with a value of "0" (zero). My template looks something like this: ``` {{#count}}{{{count}}} items{{/count}} {{^count}}-{{/count}} ``` If `myModel.count = 0`, the rendered html is nothing. It's like the value "count" is null and not null at the same time. Mustache documentation for this case: https://github.com/janl/mustache.js#inverted-sections