I've registered this helper on my app file:
hbs.registerHelper('if_greater', (a, b, opts) => {
if (a >= b) return opts.fn(this);
return opts.inverse(this);
});
Then, on my hbs file:
{{#if_greater 20 occurrences}}
<tr class="danger">
<td>{{this.date}}</td>
<td>{{this.serial}}</td>
<td>{{this.operator}}</td>
<td>{{this.vehicle}}</td>
<td>{{this.stop}}</td>
<td>{{this.line}}</td>
<td>{{this.zone}}</td>
<td>{{this.occurrences}}</td>
<td>{{this.encrypted}}</td>
</tr>
{{/if_greater}}
However, this.date
doesn't output anything, neither does calling date
. I can output it if I don't call my helper. What's wrong in the helper?