Skip to content
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

Is there a way to access array elements? #77

Open
PhilAndrew opened this issue Jan 24, 2018 · 2 comments
Open

Is there a way to access array elements? #77

PhilAndrew opened this issue Jan 24, 2018 · 2 comments

Comments

@PhilAndrew
Copy link

Like first name: {{people.0.first_name}}

Can I access the first one in a list like this?

@PhilAndrew
Copy link
Author

Please please help!

@mwunsch
Copy link
Owner

mwunsch commented Jan 26, 2018

Hi @PhilAndrew. I think this project is likely abandoned or dormant. It's been several years since I made a contribution to this project, but here's where I can point you.

Handlebars js does not have a mechanism to do this index-based lookup as far as I'm aware. Instead, it uses the lookup helper to resolve paths at specific indices. I would suggest writing your own helper to resolve this or try to get an understanding of https://github.com/mwunsch/handlebars.scala/blob/master/src/main/scala/com/gilt/handlebars/scala/binding/dynamic/DynamicBinding.scala

It's entirely possible with certain Scala structures that your example might work, but creating a helper for your specific use case is probably the fastest way to resolve. @chrhicks or @timcharper might be able to help, and I hope they forgive my ping. Otherwise, check the network of this project for more active forks. Best of luck.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants