3 ms·
The Handlebars template engine works the way you're talking about. The "each" helper loops through an array. You can put in an "else" block for when the array i
by combatentropy 8y ago
The Handlebars template engine works the way you're talking about. The "each" helper loops through an array. You can put in an "else" block for when the array is empty.
{{#each paragraphs}}
<p>{{this}}</p>
{{else}}
<p class="empty">No content</p>
{{/each}}
--- https://handlebarsjs.com/builtin_helpers.html https://handlebarsjs.com/builtin_helpers.html