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
I know we can change the varname to another string, but coming from other template engines like angular or Laravel's blade, the variables are not tied to a global it variable. They exist on the top level scope.
Is this at all possible? I know it's not a huge deal to type =it everywhere, but it trips me up all the time because the other engines I use don't behave like this.
The text was updated successfully, but these errors were encountered:
The local variables can be used inside template - that's the reason not to use property names without object. Those local variable names are used for iteration, e.g., and can be used for anything. There was an attempt to remove it in the fork: houd1ni@67da310
But it breaks iteration. A more comprehensive attempt would require parsing JavaScript in template and differentiating between local variables and properties of it. It would destroy the main advantage of doT - it's small size and also make template compilation slow. It also would make it difficult to differentiate between it properties and local variables in any even moderately complex template.
thanks, appreciate the explanation. Would it be helpful to add something relating to this to the readme? I'm sure I'm not the only one to have this thought
I know we can change the varname to another string, but coming from other template engines like angular or Laravel's blade, the variables are not tied to a global
it
variable. They exist on the top level scope.For instance, I want to do this in dot:
bundle
Template
Is this at all possible? I know it's not a huge deal to type
=it
everywhere, but it trips me up all the time because the other engines I use don't behave like this.The text was updated successfully, but these errors were encountered: