javascript - RactiveJS - Advanced condition in conditionals structures -
In the documentation of RativeJS, we can check the condition in the template that any variable is true or false ... Is possible to make a little more detail?
Something like {{# var == 1 & amp; Var2 == 2}} HTML code {{/ var}}
?
I have many possibilities for the form and if I have to adhere to each variable to make the conditions, then it is really too long & amp; The toughest ...
If we can not do this, someone can advise me to find a good library to do data bindings =)
Edit: < / P>
> After more testing, I know this code is okay
{{# var1 == '1' || Var2 == '2'}} Ok {{}}
but this code is not
{{# var1 == '1' & amp; ; & Amp; Var2 == '2'}} Ok {{}}
Is this normal?
Plunkr =>
As I mentioned on the github issue, your Emergence to & amp; Amp;
& lt; Script & gt; Use
tag, a & lt; Form & gt;
.
If you need to handle more complex logic, call them and call them:
{{# isOk (var1, var2)}} Ok {{}}
or you can put your logic in your model (if it is there).
Comments
Post a Comment