Hi,
certainly a stupid question but, how to get the 'i' of an iteration when we map an array on a screen?
I mean, I want to know on wich iteration we are.
Can someone provide a JS code for that ?
Thanks
Sylvain
Hi,
certainly a stupid question but, how to get the 'i' of an iteration when we map an array on a screen?
I mean, I want to know on wich iteration we are.
Can someone provide a JS code for that ?
Thanks
Sylvain
Found an answer
for those who are interested, here is my solution (may be not the best but working):
var indexElement=element[0].attributes._idx.nodeValue;
indexElement=indexElement.substring(1);
console.log(parseInt(indexElement,10));
in the mapping, where you put your 'i' collection