| Page 1 of 1 | [ 4 posts ] |
|
Hi!
I was wondering if there's a way to know the current index of the iteration when using the #each helper. Something like accessing the {{currentIndex}} value shown below. Code: {{#someArray}} {{currentIndex}} {{/someArray}} As a last resort, I'm thinking I might just have to add an index attribute to each of the objects in the array that the #each will be iterating over. Thanks. |
|
It does not supply the index to an `{{#each}}` block:
https://github.com/wycats/handlebars.js ... ase.js#L59 |
|
Hi there,
Oh well, that's not a big deal. There's a perfectly suitable (and perhaps cleaner) workaround, which I stated above. Thanks for responding, Eric. |
|
Yeah, I agree.
The limitations imposed by Handlers are good at keeping one from putting too much logic/coding in their templates. |
| Page 1 of 1 | [ 4 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group