Hello,
Is it possible to get the instance number for an #each loop ?
My template is like this :
{{#each homeTeam.players}}
{{>playerPill}}
{{/each}}
playerPill.html
<template name="playerPill">
<button class="pillForModal btn btn-primary" data-toggle="modal" data-target="#playerModal" type="button">Numéro <span class="badge">{{jersey}}</span></button>
</template>
The homeTeam.players Array looks like this :
"homeTeam" : {
"players" : [
{
"firstName" : null,
"lastName" : null,
"jersey" : 1
},
{
"firstName" : null,
"lastName" : null,
"jersey" : 2
},
{
"firstName" : null,
"lastName" : null,
"jersey" : 3
}
]
}
What I want if to pass in a modal and next in my update query for the DB the index of the #each loop ?
I know Meteor is currently reviewing the solution for my problem https://github.com/meteor/meteor/pull/3560 but I can’t wait for this solution…
Is it possible via Template.instance() to get the index number for the #each loop ?
Thanks for the help.
Dexterneo