Play Games

Search This Blog

Tuesday, August 25, 2020

For loop in aura component or how to iterate a list in aura component - Salesforce Globe For You

 For loop in aura component  - Salesforce Globe For You 

ForLoop.cmp

<aura:component >

    <aura:attribute name="fruits" type="List" default="['Mango','Apple','Orange','Kiwi']"/>

    The available fruits are <br/>

    <aura:iteration items="{!v.fruits}" var="fruit" indexVar="index">

        {!index+1}) {!fruit}<br/>

    </aura:iteration>

</aura:component>


TestApp.app

<aura:application extends="force:slds">

<c:ForLoop/>

</aura:application>


Output:


No comments:

Post a Comment