Adding navigation support using Lightning :navigation

The Lightning :navigation component uses a special type of JavaScript object named pageReference to navigate to other Lightning Components or standard views and standard object pages. The Lightning Component must implement a special interface named Lightning :isUrlAddressable to allow itself to be navigated from other components.

A pageReference object structure is shown in the following code snippet. (Note that it is comprised of a type (string type), attributes (object), and state (object). Let's take a look at it:

var pageReference = {            type: 'standard__objectPage', //standard__component,standard__knowledgeArticlePage,standard__namedPage,standard__navItemPage,standard__objectPage,standard__recordPage,standard__recordRelationshipPage ...

Get Learning Salesforce Lightning Application Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.