If you add the JSON response which is having the array directly to the Lightning Component Attribute, It is not working.
JSON RESPONSE for response.myData:
[{"attributes":{"type":"TEST"},"pId":"A101","entries":[{"value":"val1"},{"value":"val2"}],"myIndex":0}]
Issue: Not able to access entries and myIndex which are coming after entries (which is Array).
Example: cmp.set('v.myData', response.myData);
Solution:
Stringify and Parse it like below -
cmp.set('v.myData', JSON.parse(JSON.stringify(response.myData)));
JSON RESPONSE for response.myData:
[{"attributes":{"type":"TEST"},"pId":"A101","entries":[{"value":"val1"},{"value":"val2"}],"myIndex":0}]
Issue: Not able to access entries and myIndex which are coming after entries (which is Array).
Example: cmp.set('v.myData', response.myData);
Solution:
Stringify and Parse it like below -
cmp.set('v.myData', JSON.parse(JSON.stringify(response.myData)));