3

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.

0

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");
    evt.setParams({
        componentDef: "c:YourHomeComponent",
        componentAttributes: {
            myAttribute: component.get("v.someAttribute")
        }
    });
    evt.fire();    
}

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.