You need to sign in to do that
Don't have an account?
Mohammed Sheriff 1
how to pass data from one lightning page to another
How can I pass data from one lightning component and to another lightning component. Please help ?
Thanks in advance
Thanks in advance
You can use the below code.
Component Name: First_Component
<aura:component >
<aura:attribute name="Data" type="String" default="abcd"/>
<c:Second_Component showData="{!v.Data}"/>
</aura:component>
Component Name: Second_Component
<aura:component >
<aura:attribute name="showData" type="String"/>
{!v.showData}
</aura:component>
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks and Regards,
Ajay Dubedi
www.ajaydubedi.com
All Answers
It depends if they are parent-child components or different components.
You should use the events :
Component event is for passing data between parent-child components.
Application event is for passing data between different components.
Here you can find the documentation :
https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/events_intro.htm
Have a good day !
Valentin
You can use the below code.
Component Name: First_Component
<aura:component >
<aura:attribute name="Data" type="String" default="abcd"/>
<c:Second_Component showData="{!v.Data}"/>
</aura:component>
Component Name: Second_Component
<aura:component >
<aura:attribute name="showData" type="String"/>
{!v.showData}
</aura:component>
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks and Regards,
Ajay Dubedi
www.ajaydubedi.com