You need to sign in to do that
Don't have an account?
srinath vallab
How to pass parameters while navigating from lwc to lightning component?
As we know we navigate from lightning component to lightning component using force:navigateToComponent event along with parameters.
Below is sample code to navigate.
var evt = $A.get("e.force:navigateToComponent"); evt.setParams({ componentDef : "c:myComponent", componentAttributes: { contactName : component.get("<some attribute>") } }); evt.fire();
And we can navigate from lwc to lightning component using below code:
this[NavigationMixin.Navigate]({ "type": "standard__component", "attributes": { "componentName": "c__NavigationDemoComponent" } });
In the second code snippet(from lwc to lightning), how can i pass parameter?
Below is sample code to navigate.
var evt = $A.get("e.force:navigateToComponent"); evt.setParams({ componentDef : "c:myComponent", componentAttributes: { contactName : component.get("<some attribute>") } }); evt.fire();
And we can navigate from lwc to lightning component using below code:
this[NavigationMixin.Navigate]({ "type": "standard__component", "attributes": { "componentName": "c__NavigationDemoComponent" } });
In the second code snippet(from lwc to lightning), how can i pass parameter?
I have done walkthrough of your code, it seems like that have solved same problem before.
Please have a look on the below referance and let me know if you will face or it will not help you.
https://developer.salesforce.com/forums/ForumsMain?id=9062I000000IMNBQA4
If this solution is helpful then please mark it as Best Answer.
Thanks,
Ankit Rathor