-
Notifications
You must be signed in to change notification settings - Fork 422
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
Path accessor to prevent walking up the scope #645
Comments
Is |
@stevenvachon You can use either As for the issue, personally I would rather fix this issue in JavaScript rather than adding the complexity of paths to mustache. |
@matthewp Is there some straightforward way to fix this in javascript beyond renaming attributes? I have handlebars templates that I'm trying to transition to mustache right now that render something inherently recursive. So this abstract object can have one or more similar objects within it, so they all share the same attributes, but each does not necessarily have all. All that to say renaming isn't really an option. Just hoping that may motivate the issue a bit. |
Yes, but I was referring to the context change. Also, I'm not so sure that it can be fixed in JavaScript. |
Talked this over off-issue, I wasn't aware that |
Fixed via #874 |
There are some valid use cases where walking up the scope for a property lookup is not what you want. For example:
And
Will render
CanJS school
as the first item. The best solution is probably prefixing the property name with a./
accessor if you don't want it to be looked up in the parent scope:The text was updated successfully, but these errors were encountered: