You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When mutating a variable inside a for-loop, these changes get reverted on loop exit.
This is quite unlike most programming languages. Unfortunately this makes you use more boilerplate code inside templates than necessary.
The text was updated successfully, but these errors were encountered:
If you'd like to propose a change to the for tag, I'd recommend making an issue in the appropriate repository (https://github.com/kylef/Stencil/issues), as we can't override/modify existing Stencil tags. If you'd like to propose new tags/filters, we could discuss this here if appropriate.
I did check the sources of the stencil library and currently they actually appear to implement override sematics for extensions by same tags. Though I'll do an experiment on this later.
@kaygro while this is really unlike done in programming languages, this is inline with Jinja 2 behaviour, which I guess was the main inspiration for Stencil. It does though provide namespace feature to solve this issue. http://jinja.pocoo.org/docs/2.10/templates/
When mutating a variable inside a for-loop, these changes get reverted on loop exit.
This is quite unlike most programming languages. Unfortunately this makes you use more boilerplate code inside templates than necessary.
The text was updated successfully, but these errors were encountered: