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

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

c# - Exception when attempting to modify Dictionary -