Navigate from a Lightning Component to Another (Beta)

The force:navigateToComponent event enables you navigate to another component easily within Salesforce1 and Lightning Experience.
Note

Note

This release contains a beta version of force:navigateToComponent that’s production quality but has known limitations. This feature isn’t generally available unless or until Salesforce announces its general availability in documentation or in press release or public statements. We can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features. You can provide feedback and suggestions for this feature in the IdeaExchange.

To navigate from a Lightning component to another, specify the component name using componentDef. This example navigates to a component c:myComponent and sets a value on the contactName attribute.

navigateToMyComponent : function(component, event, helper) {
        var evt = $A.get("e.force:navigateToComponent");
        evt.setParams({
            componentDef : "c:myComponent",
            componentAttributes: {
                contactName : component.get("v.contact.Name")
            }
        });
        evt.fire();
    }

You can navigate only to a component that’s marked access="global" or a component within the current namespace.