What is the way to refer index variable inside looping aura:iteration?
The code below results in error:
Failed to save undefined: expecting a positive integer, found 'indx'
at column 10 of expression: v.labels[indx]: Source
<aura:iteration var="item" items="{!v.items}" indexVar="indx">
<li>
<label class="card-detail-label">{!v.labels[indx]}</label>
<span class="card-detail-value">{!item}</span>
</li>
</aura:iteration>
Best Answer
It does not look like a variable defined as indexVar was meant to be used as part of another expression.
e.g. this works
I think in your example "item" should be changed from final value to an object which has properties .label and .value, something like this: