-
-
Notifications
You must be signed in to change notification settings - Fork 382
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
Add @value to context when iterating over maps/iterables #540
Conversation
Add @value to context to more semantic the access to map key/value pairs
Hello @giflw thanks for your pull. Is this supported by handlebarsjs? If so, then can you please add a two test: one with list input the other with a hash/map input. |
Hi @jknack . I have no idea if this is supported on JS. I was just using the Java version now, and seems to me that it would be semantically better than using {{this}} to access the value of the map entry. |
Yea, just tried at http://tryhandlebarsjs.com/ and isn't supported by handlebars.js This creates incompatibilities between the two implementations so don't think is a good idea to add this for now. That's being said, let's keep this pull open and if more users find it valuable then I will merge. Thanks again. |
Maybe this change can be made in JS version too. I just need to have a little more time to do that. I think this is the file that need to be modified: https://github.com/wycats/handlebars.js/blob/e8ceafa6525a5d41a20aa74dfe24bf99d0bc2fcd/lib/handlebars/helpers/each.js. This way, there will be no incompatibilities. |
That will be ideal, yes! |
I made a proposal there handlebars-lang/handlebars.js#1253. |
Rejected as explained in related handlebars.js issue |
Add @value to context to more semantic the access to map key/value pairs