Showing posts with label Aura iteration in lightning component. Show all posts
Showing posts with label Aura iteration in lightning component. Show all posts

Friday, September 7, 2018

Aura iteration in lightning component

Aura iteration iterates over the collection of items and renders body for each item in the collection.

Syntax:

<aura:iteration items="{!v.listname}" var="somevariable">
         {!somevariable}   
</aura:iteration>


Let's display a list in the lightning component.

<aura:component > 

<aura:attribute type="List" name="Listattribute" default="{'Apple','Orange','Mango'}" />

    <aura:iteration items="{!v.Listattribute}" var="m">
         {!m}   
    </aura:iteration>

</aura:component>