You need to sign in to do that
Don't have an account?
Michael J. Lupino
Using force:navigateToComponent Not Saving in Dev Console
I am attempting to use force:navigateToComponent but running into an odd issue. The internet sites that I'm using as reference seams to point me that I'm following the right path but I'm unclear on the error. Its preventing me from saving the page:
<aura:component>
<lightning:button variant="brand" label="Button Text" onclick="{!c.Navigate}" />
</aura:component>
Controller JS:
Navigate : function(component, event, helper) {
var evt = $A.get("e.force:navigateToComponent");
evt.setParams({
componentDef : "c:component2",
});
evt.fire();
}
Error Reported on Save: Failed to save undefined: markup://aura:component cannot be instantiated directly. Component will not save in developer console.
Source Materials:
https://developerprob.blogspot.com/2016/06/navigate-from-one-component-to-another.html
https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/ref_force_navigateToComponent.htm
<aura:component>
<lightning:button variant="brand" label="Button Text" onclick="{!c.Navigate}" />
</aura:component>
Controller JS:
Navigate : function(component, event, helper) {
var evt = $A.get("e.force:navigateToComponent");
evt.setParams({
componentDef : "c:component2",
});
evt.fire();
}
Error Reported on Save: Failed to save undefined: markup://aura:component cannot be instantiated directly. Component will not save in developer console.
Source Materials:
https://developerprob.blogspot.com/2016/06/navigate-from-one-component-to-another.html
https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/ref_force_navigateToComponent.htm
MagulanDuraipandian
Try to recreate the lightinng component. I have done this withoug issues - http://www.infallibletechie.com/2018/03/lightning-component-navigation-in.html