angular-cn/aio/dist/generated/docs/api/router/NavigationBehaviorOptions.json

5 lines
7.6 KiB
JSON

{
"id": "api/router/NavigationBehaviorOptions",
"title": "NavigationBehaviorOptions",
"contents": "\n\n<article>\n <div class=\"breadcrumb-container\">\n <div class=\"breadcrumb\">\n <script type=\"application/ld+json\">\n {\n \"@context\": \"http://schema.org\",\n \"@type\": \"BreadcrumbList\",\n \"itemListElement\": [\n { \"@type\": \"ListItem\", \"position\": 1, \"item\": { \"@id\": \"https://angular.io//api\", \"name\": \"API\" } },\n { \"@type\": \"ListItem\", \"position\": 2, \"item\": { \"@id\": \"https://angular.io/api/router\", \"name\": \"@angular/router\" } },\n { \"@type\": \"ListItem\", \"position\": 3, \"item\": { \"@id\": \"https://angular.io/api/router/NavigationBehaviorOptions\", \"name\": \"NavigationBehaviorOptions\" } }\n ]\n }\n </script>\n <a href=\"/api\">API</a> > <a href=\"api/router\">@angular/router</a>\n </div>\n <div class=\"github-links\">\n <a href=\"https://github.com/angular/angular/edit/master/packages/router/src/router.ts?message=docs(router)%3A%20describe%20your%20change...#L144-L195\" aria-label=\"Suggest Edits\" title=\"Suggest Edits\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">mode_edit</i></a>\n <a href=\"https://github.com/angular/angular/tree/12.0.0-next.7/packages/router/src/router.ts#L144-L195\" aria-label=\"View Source\" title=\"View Source\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">code</i></a>\n</div>\n </div>\n \n <header class=\"api-header\">\n <h1 id=\"navigationbehavioroptions\">NavigationBehaviorOptions<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/router/NavigationBehaviorOptions#navigationbehavioroptions\"><i class=\"material-icons\">link</i></a></h1>\n \n <label class=\"api-type-label interface\">interface</label>\n \n \n \n </header>\n \n <aio-toc class=\"embedded\"></aio-toc>\n\n <div class=\"api-body\">\n \n <section class=\"short-description\">\n <p>Options that modify the <code><a href=\"api/router/Router\" class=\"code-anchor\">Router</a></code> navigation strategy.\nSupply an object containing any of these properties to a <code><a href=\"api/router/Router\" class=\"code-anchor\">Router</a></code> navigation function to\ncontrol how the navigation should be handled.</p>\n\n \n </section>\n \n \n <section class=\"interface-overview\">\n<code-example language=\"ts\" hidecopy=\"true\">\ninterface <a href=\"api/router/NavigationBehaviorOptions\" class=\"code-anchor\">NavigationBehaviorOptions</a> {\n <a class=\"code-anchor\" href=\"api/router/NavigationBehaviorOptions#skipLocationChange\"><span class=\"member-name\">skipLocationChange</span>?: boolean</a>\n <a class=\"code-anchor\" href=\"api/router/NavigationBehaviorOptions#replaceUrl\"><span class=\"member-name\">replaceUrl</span>?: boolean</a>\n <a class=\"code-anchor\" href=\"api/router/NavigationBehaviorOptions#state\"><span class=\"member-name\">state</span>?: {...}</a>\n}\n</code-example>\n\n \n \n <div class=\"descendants interface\">\n <h2 id=\"child-interfaces\">Child interfaces<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/router/NavigationBehaviorOptions#child-interfaces\"><i class=\"material-icons\">link</i></a></h2>\n \n\n<ul>\n \n <li>\n <code><a href=\"api/router/NavigationExtras\" class=\"code-anchor\">NavigationExtras</a></code>\n \n\n\n </li>\n \n</ul>\n\n\n </div>\n \n\n\n \n \n\n</section>\n\n \n<section class=\"see-also\">\n <h2 id=\"see-also\">See also<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/router/NavigationBehaviorOptions#see-also\"><i class=\"material-icons\">link</i></a></h2>\n <ul>\n \n <li><p><a href=\"api/router/Router#navigate\">Router.navigate() method</a></p>\n</li>\n <li><p><a href=\"api/router/Router#navigatebyurl\">Router.navigateByUrl() method</a></p>\n</li>\n <li><p><a href=\"guide/router\">Routing and Navigation guide</a></p>\n</li>\n </ul>\n</section>\n\n\n \n \n \n<section class=\"instance-properties\">\n <h2 id=\"properties\">Properties<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/router/NavigationBehaviorOptions#properties\"><i class=\"material-icons\">link</i></a></h2>\n <table class=\"is-full-width list-table property-table\">\n <thead>\n <tr>\n <th>Property</th>\n <th>Description</th>\n </tr>\n </thead>\n <tbody>\n \n <tr class=\"instance-property\">\n <td>\n <a id=\"skipLocationChange\"></a>\n <code class=\"\"><span class=\"member-name\">skipLocationChange</span>?: boolean</code>\n </td>\n <td>\n \n <p>When true, navigates without pushing a new state into history.</p>\n\n <code-example>\n// Navigate silently to /view\nthis.router.navigate(['/view'], { skipLocationChange: true });\n</code-example>\n\n </td>\n </tr>\n \n <tr class=\"instance-property\">\n <td>\n <a id=\"replaceUrl\"></a>\n <code class=\"\"><span class=\"member-name\">replaceUrl</span>?: boolean</code>\n </td>\n <td>\n \n <p>When true, navigates while replacing the current state in history.</p>\n\n <code-example>\n// Navigate to /view\nthis.router.navigate(['/view'], { replaceUrl: true });\n</code-example>\n\n </td>\n </tr>\n \n <tr class=\"instance-property\">\n <td>\n <a id=\"state\"></a>\n <code class=\"\"><span class=\"member-name\"><a href=\"api/animations/state\" class=\"code-anchor\">state</a></span>?: {\n [k: string]: any;\n}</code>\n </td>\n <td>\n \n <p>Developer-defined state that can be passed to any navigation.\nAccess this value through the <code>Navigation.extras</code> object\nreturned from the <a href=\"api/router/Router#getcurrentnavigation\">Router.getCurrentNavigation()\nmethod</a> while a navigation is executing.</p>\n\n <p>After a navigation completes, the router writes an object containing this\nvalue together with a <code>navigationId</code> to <code>history.state</code>.\nThe value is written when <code>location.go()</code> or <code>location.replaceState()</code>\nis called before activating this route.</p>\n<p>Note that <code>history.state</code> does not pass an object equality test because\nthe router adds the <code>navigationId</code> on each navigation.</p>\n\n </td>\n </tr>\n \n </tbody>\n </table>\n</section>\n \n\n\n \n\n\n </div>\n</article>\n\n<!-- links to this doc:\n - api/router\n - api/router/NavigationExtras\n - api/router/Router\n - api/router/RouterLink\n - api/router/RouterLinkWithHref\n-->\n<!-- links from this doc:\n - /api\n - api/animations/state\n - api/router\n - api/router/NavigationBehaviorOptions#child-interfaces\n - api/router/NavigationBehaviorOptions#navigationbehavioroptions\n - api/router/NavigationBehaviorOptions#properties\n - api/router/NavigationBehaviorOptions#replaceUrl\n - api/router/NavigationBehaviorOptions#see-also\n - api/router/NavigationBehaviorOptions#skipLocationChange\n - api/router/NavigationBehaviorOptions#state\n - api/router/NavigationExtras\n - api/router/Router\n - api/router/Router#getcurrentnavigation\n - api/router/Router#navigate\n - api/router/Router#navigatebyurl\n - guide/router\n - https://github.com/angular/angular/edit/master/packages/router/src/router.ts?message=docs(router)%3A%20describe%20your%20change...#L144-L195\n - https://github.com/angular/angular/tree/12.0.0-next.7/packages/router/src/router.ts#L144-L195\n-->"
}