NavigationStart
class
Represents an event triggered when a navigation starts.
class NavigationStart extends RouterEvent { constructor(id: number, url: string, navigationTrigger: 'imperative' | 'popstate' | 'hashchange' = 'imperative', restoredState: {...}) navigationTrigger?: 'imperative' | 'popstate' | 'hashchange' restoredState?: {...} toString(): string // inherited from router/RouterEvent constructor(id: number, url: string) id: number url: string }
Constructor
|
id | Type: |
url | Type: |
navigationTrigger | Type: Optional. Default is |
restoredState | Type: Optional. Default is |
Properties
Property | Description |
---|---|
navigationTrigger?: 'imperative' | 'popstate' | 'hashchange' | Identifies the trigger of the navigation.
|
restoredState?: {
navigationId: number;
} | null | This contains the navigation id that pushed the history record that the router navigates back to. This is not null only when the navigation is triggered by a popstate event. The router assigns a navigationId to every router transition/navigation. Even when the user clicks on the back button in the browser, a new navigation id will be created. So from the perspective of the router, the router never "goes back". By using the |
Methods
toString() |
---|
|
© 2010–2019 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://v6.angular.io/api/router/NavigationStart