Getting index within Each Helper
See original GitHub issueThis works in Handlebars:
{{#each array}}
{{@index}}: {{this}}
{{/each}}
This fails in Emblem:
ul
each App.things
li {{@index}}
I get this error:
Uncaught Error: Emblem syntax error, line 1: Expected BeginStatement or DEDENT but "=" found. =@index
Perhaps this is not an issue, but I thought Emblem was intended to behave functionally like Handlebars.
Issue Analytics
- State:
- Created 9 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
How to get index in Handlebars each helper? - Stack Overflow
I'm using Handlebars for templating in my project. Is there a way to get the index of the current iteration of an "each"...
Read more >Building a Handlebars "each with index" helper
Here's a super quick post about building a Handlebars helper in an Ember app for numbering lists in the context of an {{each}}...
Read more >JavaScript : How to get index in Handlebars each helper?
JavaScript : How to get index in Handlebars each helper ? [ Gift : Animated Search Engine : https://bit.ly/AnimSearch ] JavaScript : How...
Read more >Include index in each block helper, aka each_with_index #250
Seems like I get 'Cannot call method 'replace' of undefined' when trying to use it with that syntax. With the {{#each bar}} syntax,...
Read more >Built-in Helpers - Handlebars
You can iterate over a list using the built-in each helper. Inside the block, you can use this to reference the element being...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
In case anyone runs into it today and finds this like I did:
Thanks @cbellino for digging in 😃