function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Michael J. LupinoMichael 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



 
MagulanDuraipandianMagulanDuraipandian
Try to recreate the lightinng component. I have done this withoug issues - http://www.infallibletechie.com/2018/03/lightning-component-navigation-in.html