Menu Close
    Start a Project Request quote Reading list Switch to dark mode

    How to Navigate within Lightning Components

    In this blog, we will learn how to navigate within Lightning Components. Let’s get started!

    Event Used

    We will be using force:navigateToComponent. It allows us to navigate from one component to another. Still, we should keep following points in mind:

    • Through this event we can only navigate to Components.
    • The access of the component should be set to global.
    • It will not work in, the navigation will only work within tab.
    • Also, the URL generated through this event is not permanent, it keeps on changing as we navigate.

    Now, let’s get started with the code.

    Component 1 :

    Component 1 controller :

    Controller 2:

    Component 2 controller :


    For output, you have to create a Lightning Tab using one of the components, and add it to an app through App Manager.

    Component 1:

    Component 2:


    That’s all for how to navigate within Lightning Components, still, if you have any issue feel free to add a ticket and let us know your views to make the code better


    . . .


    Add Your Comment

    Be the first to comment.

    Back to Top
    Hire Us!
    Brief us about your requirements and we'll get back to you.
    Woo! Hooy!
    We have just recieved your project brief and our expert will contact you shortly.
    Send Again

    Table of Content

    Hide Index