Add support for each-* creating an {name}_index iteration count;
this is 0-based. If each-* happens to be given an object, then _index will contain the key.
Showing
1 changed file
with
1 additions
and
0 deletions
... | @@ -347,6 +347,7 @@ Rivets.binders = | ... | @@ -347,6 +347,7 @@ Rivets.binders = |
347 | data = {} | 347 | data = {} |
348 | data[n] = m for n, m of @view.models | 348 | data[n] = m for n, m of @view.models |
349 | data[@args[0]] = item | 349 | data[@args[0]] = item |
350 | data["#{@args[0]}_index"] = i | ||
350 | itemEl = el.cloneNode true | 351 | itemEl = el.cloneNode true |
351 | if iterated.length > 0 | 352 | if iterated.length > 0 |
352 | previous = iterated[iterated.length - 1].els[0] | 353 | previous = iterated[iterated.length - 1].els[0] | ... | ... |
-
Please register or sign in to post a comment