Conditions inside templates
Closed this issue · 1 comments
stelonix commented
Since documentation seems to be vague, I'm not sure whether I've missed it... Is it not possible to use conditionals inside @ blocks? Eg. in below example:
@model.trabalhos.forEach(function(t) {
<span class="bg">
<span>@t.data.dia de @model.meses[t.data.mes-1] de @t.data.ano</span>
<p>@t.nome</p>
@if (typeof t.desc !=== null) {
<p>@t.desc %></p>
} else {
<p class="b">@t.tipo - @t.farda</p>
}
</span>
})
I'm getting some kind of infinite recursion error. Is this not at all supported by the engine? if it isn't, how do I achieve a similar goal using vash? Error below:
SyntaxError: Problem while rendering template at line 0, character 0.
Original message: Problem while compiling template at line 0, character 0.
Original message: Unexpected token =.
stelonix commented
It was actually a syntax error on my side, too many '='