I am having the same issue. Trying to access array with dynamic index arrayList[index] (index from aura:iteration), but Salesforce doesn't support that.
Does anyone know how to do this?
Peace of code:
<aura:attribute name="iterList" type="List" />
<aura:attribute name="phones" type="String[]" />
<aura:iteration items="{! v.iterList }" var="val" indexVar="index">
//some code here
<ui:inputPhone label="{! v.labelName }" aura:id="phone" value="{! v.phones[index] }" class="form-control"/>
//some code here
</aura:iteration>
Error:
Result: [ERROR]: expecting a positive integer, found 'index' at column 11 of expression: v.phones[index]
var finalArray = [];for(var i = 0; i < arr1.length; i++){ finalArray.push({arr1: arr1[i]m arr2: arr2[i]}) }
and finally iterate overfinalArray
and access both the array values witharr1
&arr2
inside theaura:iteration
.