• Overview
@angular/router

NavigationStart

Class

An event triggered when a navigation starts.

  
    class NavigationStart extends RouterEvent {}
  
  

restoredState

{ [k: string]: any; navigationId: number; } | null | undefined

The navigation state that was previously supplied to the pushState call, when the navigation is triggered by a popstate event. Otherwise null.

The state object is defined by NavigationExtras, and contains any developer-defined state value, as well as a unique ID that the router assigns to every router transition/navigation.

From the perspective of the router, the router never "goes back". When the user clicks on the back button in the browser, a new navigation ID is created.

Use the ID in this previous-state object to differentiate between a newly created state and one returned to by a popstate event, so that you can restore some remembered state, such as scroll position.

toString

string
@returnsstring

id

number

A unique ID that the router assigns to every router navigation.

url

string

The URL that is the destination for this navigation.

Jump to details