Allow conditions in variable node (#243)

* use condition in variable node

* added support for else expression

* addressing code review comments
This commit is contained in:
Ilya Puchka
2018-09-22 14:09:25 +03:00
committed by GitHub
parent 2c3962a3de
commit df2e193891
4 changed files with 69 additions and 3 deletions

View File

@@ -22,7 +22,9 @@
### New Features
_None_
- Now you can conditionally render variables with `{{ variable if condition }}`, which is a shorthand for `{% if condition %}{{ variable }}{% endif %}`. You can also use `else` like `{{ variable1 if condition else variable2 }}`, which is a shorthand for `{% if condition %}{{ variable1 }}{% else %}{{ variable2 }}{% endif %}`
[Ilya Puchka](https://github.com/ilyapuchka)
[#243](https://github.com/stencilproject/Stencil/pull/243)
### Internal Changes