-
Notifications
You must be signed in to change notification settings - Fork 80
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
Feature Request - {{@index}} #8
Comments
I can see that being a useful feature. I wasn't even aware of it. I will On Thu, Jul 18, 2013 at 2:16 PM, sdeller notifications@github.com wrote:
|
This feature is now available with 0.1.2.0. Instead of |
Thanks Travis! Kicking the tires on it, and ran into a minor glitch This works fine
This works fine
This works fine
This throws an exception: "The wrong number of arguments were passed to an index tag."
It seems that if you have 2 each loops over the same list/array, and the first loop has a {{#index}} and does not at least have 1 reference to an object property, it throws the exception. The second loop does not have a problem, even if it doesn't have a property reference in it For reference, here is how I am passing the template and object in.
and the test object definition List objectSource = new List(); public class TestObject |
I think I fixed my issue. Please get the latest version and run your tests Your example made me realize a subtle inconsistency in the way mustache# On Mon, Jul 22, 2013 at 7:18 PM, sdeller notifications@github.com wrote:
|
any chance the shiny new #index parameter will be accessible from the #if conditional? ex: {{#each this}} |
Not yet...
|
One of the things we used frequently in front-end handlebars.js implementations was the item index over array loops to help with various jquery/css sliders, etc. I don't see direct support for the {{@Index}} var in the current mustache# build. is there a mechanism to reference the loop index in an "each" construct, or are there plans for future support?
The text was updated successfully, but these errors were encountered: