Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conditions inside templates #121

Closed
stelonix opened this issue Sep 1, 2017 · 1 comment
Closed

Conditions inside templates #121

stelonix opened this issue Sep 1, 2017 · 1 comment

Comments

@stelonix
Copy link

stelonix commented Sep 1, 2017

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 stelonix closed this as completed Sep 8, 2017
@stelonix
Copy link
Author

stelonix commented Sep 8, 2017

It was actually a syntax error on my side, too many '='

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant