I have the following code:
{{#if true}} An {{else}} A {{/if}
That's the entire template. It's loading fine. But notice the #if
condition is simply true
. If I put anything other than a literal there, it doesn't work. Any variable I put, any sort of programmatic expression like {{#if 3 > 5}}
, it gives me a Parser Error:
Error: Parse error on line 36:
{{#if 3 > 5 }} An {{else}} A
---------------------^
Expecting 'CLOSE_RAW_BLOCK', 'CLOSE', 'CLOSE_UNESCAPED', 'OPEN_SEXPR', 'CLOSE_SEXPR', 'ID', 'OPEN_BLOCK_PARAMS', 'STRING', 'NUMBER', 'BOOLEAN', 'UNDEFINED', 'NULL', 'DATA', got 'INVALID'
I can't figure that out. I even reduced it to just {{#if 3 > 5}} A {{/if}}
and it still gives a parser error.
So I thought maybe you have to use a helper for this sort of thing, but I can't get any helper I register to work either.