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

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -