• Overview
@angular/router

Navigation

interface

Information about a navigation operation. Retrieve the most recent navigation object with the Router.getCurrentNavigation() method .

API

  
    interface Navigation {}
  
  

id

number

The unique identifier of the current navigation.

initialUrl

UrlTree

The target URL passed into the Router#navigateByUrl() call before navigation. This is the value before the router has parsed or applied redirects to it.

extractedUrl

UrlTree

The initial target URL after being parsed with UrlHandlingStrategy.extract().

finalUrl

UrlTree | undefined

The extracted URL after redirects have been applied. This URL may not be available immediately, therefore this property can be undefined. It is guaranteed to be set after the RoutesRecognized event fires.

trigger

"imperative" | "popstate" | "hashchange"

Identifies how this navigation was triggered.

  • 'imperative'--Triggered by router.navigateByUrl or router.navigate.
  • 'popstate'--Triggered by a popstate event.
  • 'hashchange'--Triggered by a hashchange event.

extras

NavigationExtras

Options that controlled the strategy used for this navigation. See NavigationExtras.

previousNavigation

Navigation | null

The previously successful Navigation object. Only one previous navigation is available, therefore this previous Navigation object has a null value for its own previousNavigation.

Description

Information about a navigation operation. Retrieve the most recent navigation object with the Router.getCurrentNavigation() method .

  • id : The unique identifier of the current navigation.
  • initialUrl : The target URL passed into the Router#navigateByUrl() call before navigation. This is the value before the router has parsed or applied redirects to it.
  • extractedUrl : The initial target URL after being parsed with UrlSerializer.extract().
  • finalUrl : The extracted URL after redirects have been applied. This URL may not be available immediately, therefore this property can be undefined. It is guaranteed to be set after the RoutesRecognized event fires.
  • trigger : Identifies how this navigation was triggered. -- 'imperative'--Triggered by router.navigateByUrl or router.navigate. -- 'popstate'--Triggered by a popstate event. -- 'hashchange'--Triggered by a hashchange event.
  • extras : A NavigationExtras options object that controlled the strategy used for this navigation.
  • previousNavigation : The previously successful Navigation object. Only one previous navigation is available, therefore this previous Navigation object has a null value for its own previousNavigation.
Jump to details