NavigationBehaviorOptions
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?: OnSameUrlNavigation
skipLocationChange?: boolean
replaceUrl?: boolean
state?: {...}
info?: unknown
}
Child interfaces
See also
Properties
Property | Description |
---|---|
onSameUrlNavigation?: OnSameUrlNavigation
|
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.
|
replaceUrl?: boolean
|
When true, navigates while replacing the current state in history.
|
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 |
info?: unknown
|
Read-Only
Use this to convey transient information about this particular navigation, such as how it
happened. In this way, it's different from the persisted value One example of how this might be used is to trigger different single-page navigation animations depending on how a certain route was reached. For example, consider a photo gallery app, where you can reach the same photo URL and state via various routes:
Each of these wants a different animation at navigate time. This information doesn't make sense to store in the persistent URL or history entry state, but it's still important to communicate from the rest of the application, into the router. This information could be used in coordination with the View Transitions feature and the
|