-
Notifications
You must be signed in to change notification settings - Fork 279
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
Accessing Array item by index in template #68
Comments
That isn't in the spec but I'm not entirely against implementing it. Generally though I would suggest putting something in the view that names these things better and didn't expose the data model directly in the template. |
I've decided that this is too low level to add to the core. However, I did write an extension if you need support for compatibility. You can find it here: |
+1 for this. can this be re-decided? For example, the accepted and most popular stackoverflow answer for this issue is the non-spec feature: see http://stackoverflow.com/a/17950970/122441 A mustache.java configuration option to the effect of "support non-spec features" would be awesome! An unrelated note, if everybody follows just the HTML spec we'd never have JavaScript let alone AJAX. A spec-compliant configuration option is also used by Tomcat's |
I'd rather leave stuff like this to extensions of the core rather than a bunch of options you can set. Mostly because I get asked for a tremendous number of features like this one, some of them completely orthogonal. |
Is it possible to include your extension in mustache-java's distribution JAR? That'd make it really easy to use :) |
If there is an array {arr: ["a", "b"]}, I am not able to access the array by its index.
Eg.,
<span class="{{arr.0}}">{{arr.1}}</span>
The same syntax works in mustache.js
Mustache Js Reference
The text was updated successfully, but these errors were encountered: