Iterate Map In Lightning

Usages of Lightning is increasing day by day. We face many challenge while doing development in Lightning.  One of the challenge which I face recently is we can’t iterate map in lightning using aura:iteration.  Map is commonly used collection type which provide Key value pair to easy binding of data.

Today I will shae a code sample of how we can iterate map in Lightning easily.

First we need a Controller which will return Map to us.

 

Next we will create an APP to display It on UI.

We can easily iterate map in Javascript. So in App controller we will iterate this Map and will create a List. Now we can  easily iterate that List in the app.

This is the output which we will get.

Map Iteration

Do you like the post. Or want to say anything. Please let me know in comments section.

Advertisements

3 thoughts on “Iterate Map In Lightning

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.