In my Lightning Project i have 2 different components (Login Component,Home Component). What i want is when the user click the login button. The user will redirect to the home component.


Try this

In Login Component component

<ui:button label="Navigate to foo" press="{!c.navigateToHome}"/>

In Login controller

navigateToHome : function(component, event, helper) {
var evt = $A.get("e.force:navigateToComponent");
        componentDef: "c:YourHomeComponent",
        componentAttributes: {
            myAttribute: component.get("v.someAttribute")
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.