You need to sign in to do that
Don't have an account?
aura:iteration not showing records from sObject
Hii,
I was just trying to learn some aura comonent, while trying with aura:iteration to take dynamic value it's not working
Can anyone tell me where i am doing mistake.
Thanks
Rishav
I was just trying to learn some aura comonent, while trying with aura:iteration to take dynamic value it's not working
<aura:component> <aura:attribute name="expenses" type="rishav.Expense__c[]"/> <div class="row"> <aura:iteration items="{!v.expenses}" var="expense"> <p>{!expense.Name}, {!expense.rishav__Client__c}, {!expense.rishav__Amount__c}, {!expense.rishav__Date__c}, {!expense.rishav__Reimbursed__c} </p> </aura:iteration> </div> </aura:component>I am not getting where i am doing mistake , but it is not showing any record even after some records are there in my database.
Can anyone tell me where i am doing mistake.
Thanks
Rishav
After lots of mugging up i solved my problem,
Finally i found the answer of this question :
The solution is this line that i found in TrailHead " To use your record data in a Lightning component, you must wire up an Apex controller to the component.
It means that <aura:iteration> won't work with your database object untill u wire up a controller class in your component. and write the method inside the controller to fetch the data .
You can follow this link :
https://developer.salesforce.com/trailhead/lightning_components/lightning_components_apex
Thanks
Rishav
All Answers
After lots of mugging up i solved my problem,
Finally i found the answer of this question :
The solution is this line that i found in TrailHead " To use your record data in a Lightning component, you must wire up an Apex controller to the component.
It means that <aura:iteration> won't work with your database object untill u wire up a controller class in your component. and write the method inside the controller to fetch the data .
You can follow this link :
https://developer.salesforce.com/trailhead/lightning_components/lightning_components_apex
Thanks
Rishav