Aura:iteration is only for Arrays / list . If I have json or some kind of JS object to be iterated (like ng-repeat) how do I do it?


In your component's js controller, iterate through the properties and put them in an array.

Then use that array on aura:iteration.

I have an example here (github) that iterates all the fields on a generic sobject: https://github.com/mshanemc/soql2list/tree/master/src/aura/AllFieldDisplayer

| improve this answer | |

You can write your own aura:iteration that supports this. If you want to just use aura:iteration, you'll need to format the data into an array.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.