interface
Options that modify the Router
navigation strategy. Supply an object containing any of these properties to a Router
navigation function to control how the navigation should be handled.
interface NavigationBehaviorOptions { onSameUrlNavigation?: Extract<OnSameUrlNavigation, 'reload'> skipLocationChange?: boolean replaceUrl?: boolean state?: {...} }
Property | Description |
---|---|
onSameUrlNavigation?: Extract<OnSameUrlNavigation, 'reload'> | How to handle a navigation request to the current URL. This value is a subset of the options available in See also: |
skipLocationChange?: boolean | When true, navigates without pushing a new state into history. // Navigate silently to /view this.router.navigate(['/view'], { skipLocationChange: true }); |
replaceUrl?: boolean | When true, navigates while replacing the current state in history. // Navigate to /view this.router.navigate(['/view'], { replaceUrl: true }); |
state?: {
[k: string]: any;
} | Developer-defined state that can be passed to any navigation. Access this value through the After a navigation completes, the router writes an object containing this value together with a Note that |
© 2010–2023 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://angular.io/api/router/NavigationBehaviorOptions