You need to sign in to do that
Don't have an account?
Deepak agarwal 9
Passing List of Accounts to aura iteration and displaying them in component
Hi Folks, I am having an apex class which is having AuraEnabled method which returns list of accounts to <aura:iteration >. I am not able to display the list in component.Code is very simple nothing complicated. Need help ASAP. <aura:component controller="Accounts"> <aura:attribute name="Acc" type="Account[]" default="{'sObjectType':'Account', 'Name':'', 'Id':''}"/> <aura:iteration items="{!v.Acc}" var="acc"> <p>{!acc.Name}</p> </aura:iteration> </aura:component> //Server side controller public with sharing class Accounts { @AuraEnabled Public Static List<Account> getAccount(){ return [Select Name,id from Account LIMIT 2]; } }
Your are not using the client side controller.
Please try the below code and I am sure it will help you.
Please let me know if it helps you,
Thanks
Shivdeep
All Answers
Your are not using the client side controller.
Please try the below code and I am sure it will help you.
Please let me know if it helps you,
Thanks
Shivdeep
I am facing the same problem but I haven't figured it out yet. is it important to set up the call back in the helper?
Please help me.
thanks!!
IIT_courses__c was my custom object and Video_URL__c and Start_date__c are my fields that I wanted to display. I don'nt understand what is wrong in this code.
Check out the below code and let me know if it help.
Thanks
Shivdeep