Skip to main content
Heihei Mou 님이 #Lightning Experience에 질문했습니다
I'm using lightning component and I have create two component like below.

navigateSampleView1.cmp

<aura:component implements='force:appHostable'> <ui:button aura:id="normal" label="Go to SampleView2" press="{!c.pressButton}"/> </aura:component>

navigateSampleView1Controller.js

({ pressButton: function(component, event, helper) { var evt = $A.get("e.force:navigateToComponent"); evt.setParams({ componentDef: "c:navigateSampleView2", componentAttributes: { whom: "Lightning" } }); evt.fire(); } })

navigateSampleView2.cmp

<aura:component> <aura:attribute name="whom" type="String" default="world"/> Hello {!v.whom}! </aura:component>

Now, what I want to do is that navigate from navigateSampleView1 to navigateSampleView2, but the error is happened, please help me out!!

The error is "Uncaught error in $A.run() : Unknown component: markup://c:navigateSampleView2"
답변 7개
  1. 2016년 1월 6일 오전 7:15
    I've looked into this a lot. The best post is this: http://salesforce.stackexchange.com/questions/66954/how-to-navigate-from-one-lightning-component-to-another-lightning-component

    My current plan is that I'm taking a harder look at my UX and designing with components that do less but fit together better in order to fit better with the app builder. Depending on your use case maybe there is a different solution as well..
0/9000