May be missing something simple, but how can I specify a conditional in Handlebars based on an operation on the object?
Looking to do something like
{{#hasDiscount this}}
<tr>
<td>Discount</td>
<td>{{formatPrice this.Discount}}</td>
</tr>
{{/hasDiscount}}
With the helper along the lines of
Handlebars.registerHelper 'hasDiscount', (cart) ->
:runBlock: if cart.Discount > 0
Not sure how to tell it to run the block.
Thanks for any input.
After playing with it found an even simpler way.
Because the cart was already the object in the template I could just set the helper like this