0

I have one component in lightning where i am fetching names of products from object and i want to display that names as list one below another. I know we can use for loop but can you please share example of how to iterate names?

Thanks in advance.

  • You can always use <aura:iteration> iteration help – manjit5190 Feb 14 '17 at 6:39
  • Thanks Manjit. Can you please share one example of the same? – Sofiya Feb 14 '17 at 6:39
  • Hi Sofiya, The link that is shared in first comment contains an example. If you run into any specific issue, please let me know. – manjit5190 Feb 14 '17 at 6:47
2

Below Are Code In That I Iterate Contact Object List.

Showing All Contact List Hope This Helpful for you.

<ul>
        <aura:iteration items="{!v.contacts}" var="contact">
            <li>
                <a href="{! '#/sObject/' + contact.Id + '/view'}">
                    <p>{!contact.Name}</p>
                    <p>{!contact.Phone}</p>
                </a>
            </li>
        </aura:iteration>
    </ul>

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.