Skip to main content
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 个回答
0/9000