-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Parent context wrong for first each iteration #1831
Comments
It doesn't make sense to use It is a bug, but it seems like an edge-case. |
@jaylinski It seems like an edge-case when you use
Test 1, 2 and 3 are failing because of the content of the 1st element of the Object or Array is the same as its parent context's content. Test 4 does work as the 1st element has the content
where as all the outputs should look like the 4th.
but then to all other elements:
By the way, this doesn't seem to be related to the |
This bug is obviously being introduced by the version |
Sorry for not seeing your reply before now. Like PitPik says, it is not related to root. You could also reproduce with this example: Context: {"something": ["hallo", "fisk"]} Handlebars > 3.0.8: [object Object]hallo It seems in the new versions of handlebars, going to parent scope, will not give correct content in first iteration. |
Can easily be re-produced using http://tryhandlebarsjs.com/
Context: ["hallo", "fisk"]
Template:
{{#with this.[0]}}
{{#each @root}}{{../this}}{{/each}}
{{/with}}
Handlebars 4.0.3 (wrong): hallo,fiskhallo
Older versions returns correctly: hallohallo
The text was updated successfully, but these errors were encountered: