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

5 lines
156 KiB
JSON
Raw Normal View History

{
"id": "api/router/BaseRouteReuseStrategy",
"title": "BaseRouteReuseStrategy",
"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/BaseRouteReuseStrategy\", \"name\": \"BaseRouteReuseStrategy\" } }\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/route_reuse_strategy.ts?message=docs(router)%3A%20describe%20your%20change...#L61-L111\" 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/route_reuse_strategy.ts#L61-L111\" 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=\"baseroutereusestrategy\">BaseRouteReuseStrategy<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/router/BaseRouteReuseStrategy#baseroutereusestrategy\"><i class=\"material-icons\">link</i></a></h1>\n \n <label class=\"api-type-label class\">class</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>This base route reuse strategy only reuses routes when the matched router configs are\nidentical. This prevents components from being destroyed and recreated\nwhen just the fragment or query parameters change\n(that is, the existing component is <em>reused</em>).</p>\n\n <p><a href=\"api/router/BaseRouteReuseStrategy#description\">See more...</a></p>\n </section>\n \n \n \n <section class=\"class-overview\">\n<code-example language=\"ts\" hidecopy=\"true\">\nabstract class <a href=\"api/router/BaseRouteReuseStrategy\" class=\"code-anchor\">BaseRouteReuseStrategy</a> implements <a class=\"code-anchor\" href=\"api/router/RouteReuseStrategy\">RouteReuseStrategy</a> {\n <a class=\"code-anchor\" href=\"api/router/BaseRouteReuseStrategy#shouldDetach\"><span class=\"member-name\">shouldDetach</span>(route: ActivatedRouteSnapshot): boolean</a>\n <a class=\"code-anchor\" href=\"api/router/BaseRouteReuseStrategy#store\"><span class=\"member-name\">store</span>(route: ActivatedRouteSnapshot, detachedTree: DetachedRouteHandle): void</a>\n <a class=\"code-anchor\" href=\"api/router/BaseRouteReuseStrategy#shouldAttach\"><span class=\"member-name\">shouldAttach</span>(route: ActivatedRouteSnapshot): boolean</a>\n <a class=\"code-anchor\" href=\"api/router/BaseRouteReuseStrategy#retrieve\"><span class=\"member-name\">retrieve</span>(route: ActivatedRouteSnapshot): DetachedRouteHandle | null</a>\n <a class=\"code-anchor\" href=\"api/router/BaseRouteReuseStrategy#shouldReuseRoute\"><span class=\"member-name\">shouldReuseRoute</span>(future: ActivatedRouteSnapshot, curr: ActivatedRouteSnapshot): boolean</a>\n}\n</code-example>\n\n \n \n\n</section>\n\n\n \n\n \n \n<section class=\"description\">\n <h2 id=\"description\">Description<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/router/BaseRouteReuseStrategy#description\"><i class=\"material-icons\">link</i></a></h2>\n <p>This strategy does not store any routes for later reuse.</p>\n<p>Angular uses this strategy by default.</p>\n<p>It can be used as a base class for custom route reuse stra
}