Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

Re : Mustache: get index of the list element

$
0
0
Hi

I am really missing this feature myself and ended up using a helper like yours in my latest project. Unfortunately, I don't think you can access the index in Mustache.

Handlebars has an easy access without any helper using {{@index}}. Hopefully the CanJS team can implement it into the canjs mustache template?

From Handlebars homepage:

{{#each array}}
  {{@index}}: {{this}}
{{/each}}

Viewing all articles
Browse latest Browse all 3491

Trending Articles