{ "id": "api/router/NavigationBehaviorOptions", "title": "NavigationBehaviorOptions", "contents": "\n\n
\n
\n
\n \n API > @angular/router\n
\n \n
\n \n
\n

NavigationBehaviorOptionslink

\n \n \n \n \n \n
\n \n \n\n
\n \n
\n

Options that modify the Router navigation strategy.\nSupply an object containing any of these properties to a Router navigation function to\ncontrol how the navigation should be handled.

\n\n \n
\n \n \n
\n\ninterface NavigationBehaviorOptions {\n skipLocationChange?: boolean\n replaceUrl?: boolean\n state?: {...}\n}\n\n\n \n \n
\n

Child interfaceslink

\n \n\n\n\n\n
\n \n\n\n \n \n\n
\n\n \n
\n

See alsolink

\n \n
\n\n\n \n \n \n
\n

Propertieslink

\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
PropertyDescription
\n \n skipLocationChange?: boolean\n \n \n

When true, navigates without pushing a new state into history.

\n\n \n// Navigate silently to /view\nthis.router.navigate(['/view'], { skipLocationChange: true });\n\n\n
\n \n replaceUrl?: boolean\n \n \n

When true, navigates while replacing the current state in history.

\n\n \n// Navigate to /view\nthis.router.navigate(['/view'], { replaceUrl: true });\n\n\n
\n \n state?: {\n [k: string]: any;\n}\n \n \n

Developer-defined state that can be passed to any navigation.\nAccess this value through the Navigation.extras object\nreturned from the Router.getCurrentNavigation()\nmethod while a navigation is executing.

\n\n

After a navigation completes, the router writes an object containing this\nvalue together with a navigationId to history.state.\nThe value is written when location.go() or location.replaceState()\nis called before activating this route.

\n

Note that history.state does not pass an object equality test because\nthe router adds the navigationId on each navigation.

\n\n
\n
\n \n\n\n \n\n\n
\n
\n\n\n" }