javascript - How to get number of iteration on Meteor {{#each}}? -
this question has answer here:
how can index number of {{#each}} list in meteor? seems should simple, can't find it.
currently no build-in support that. if iterating cursor, use this:
return collection.find().map(function (doc, index, cursor) { return _.extend(doc, {index: index + 1}); })
and use
{{#each .}} {{index}} {{/each}}
Comments
Post a Comment