Another way to get it to work is to use a standard Meteor template helper with the map cursor function.
Here's an example showing how to return the index when using each with a collection:
index.html:
{{#each items}}
index: {{ this.index }}
{{/each}}
index.js:
Items = new Meteor.Collection('items');
Template.print_collection_indices.items = function() {
var items = Items.find().map(function(doc, index, cursor) {
var i = _.extend(doc, {index: index});
return i;
});
return items;
};