-
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
mustache: support for backtrack path #163
Comments
we need this for loops too, so we can do...
|
+1 for this. Without this support, here's what I have to do in a helper function to support a nested loop:
|
@whitecolor In your case you should just be able to do company.name and it should work. Handlebars isn't a full implementation of Mustache so it doesn't support nesting contexts and context jumping like we do. @moschel Brians case is valid though because if your in a nested loop like that you need the ability to hop up the stack to the parent context. |
Do we have the ability to add things to the context via a helper? We could have a name or var helper that takes 2 args. The first is the name of a property it will add to the current context, the second is the value. It could be used like {{var thing .}} And then '.' could be referenced as thing in child contexts. Sent from my iPhone On Dec 11, 2012, at 2:24 PM, Austin notifications@github.com wrote:
|
+1. |
I think it should be put in docs, didn't see it there. |
It seems that can.js doesn't support backtrack paths
{{#person}}{{name}} - {{../company.name}}{{/person}}
https://github.com/wycats/handlebars.js#paths
do you plan to add it?
The text was updated successfully, but these errors were encountered: