How to navigate from one lightning component to another lightning component?

I have tried several ways to do this and have not reached enlightenment.

I have the same problem as outlined in this question Navigation between components in lightning

I was optimistic about using navigateToUrl but only .app have available urls, and .app cannot be seen in the salesforce1 mobile application. The components are not available via a direct url.

Here is what I have found:

This works in an app but not in mobile:

$A.get("e.myNamespace:navigateToView").setParams({"view": "bar"}).fire();

For this I cannot figure out what my recordId is for my lighning component. BTW, Also tried “componentId”: “xxx” which I found in Dave Carroll’s sublime manifest file:

The following also does not work:


This works great and will take me to the homepage. I wish it worked for lightning components:


Anybody familiar with a full lightning component example that demonstrations a navigation technique that works in salesforce mobile?


Seems there is an event missing from the documentation, I went through this last week. Try this..

Component markup

<ui:button label="ATTENDANCE" press="{!c.navigateToRollCall}"/>

Controller (I am using default namespace here for my component AttendanceRollCall)

navigateToRollCall : function(component, event, helper) {
    var evt = $A.get("e.force:navigateToComponent");
            componentDef: "c:AttendanceRollCall",
            componentAttributes: {
                programId: component.get("v.program.Id")

Source : Link , Question Author : waveforms , Answer Author : Troy

Leave a Comment