devinpain
unread,Apr 24, 2017, 12:49:27 PM4/24/17Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to handlebars.java
Hi,
I am trying to do a simple thing, and really struggling to see how this would work...
in a hbs template, I am producing some json by iterating over a collection.
{{#each items}}
"id": {{id}},
"discount": {{#if ../items 'gt' 1}}1{{/if}}
{{/each}}
How would you output the discount so that the value is either 0 when the items collection size is 1 or '1' if the items collection is greater than 1?
I am struggling to find a way despite looking at the documentation. This is using the java version of handlebars.... (latest version)...
Thank you.
Y