Navigate from one component to another with variabls


How to Navigate from one component to another ?


If you are working in lightning component than you must have face this situation while you have to navigate to another component on button's click or after any event. 

If yes, so here are few line of code to get this done.


var evt = $A.get("e.force:navigateToComponent");
            evt.setParams({
                componentDef : "c:YOURCOMPONENTNAME",
                componentAttributes: {
                    VariableName: Value
                }
            });
            evt.fire();


Share this post with you friends if this help you somehow.

Post a Comment

0 Comments