5 lines
8.0 KiB
JSON
5 lines
8.0 KiB
JSON
{
|
|
"id": "api/router/RouterStateSnapshot",
|
|
"title": "RouterStateSnapshot",
|
|
"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/RouterStateSnapshot\", \"name\": \"RouterStateSnapshot\" } }\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_state.ts?message=docs(router)%3A%20describe%20your%20change...#L383-L423\" 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_state.ts#L383-L423\" 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=\"routerstatesnapshot\">RouterStateSnapshot<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/router/RouterStateSnapshot#routerstatesnapshot\"><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>Represents the state of the router at a moment in time.</p>\n\n <p><a href=\"api/router/RouterStateSnapshot#description\">See more...</a></p>\n </section>\n \n \n <section class=\"interface-overview\">\n<code-example language=\"ts\" hidecopy=\"true\">\ninterface <a href=\"api/router/RouterStateSnapshot\" class=\"code-anchor\">RouterStateSnapshot</a> extends Tree<activatedroutesnapshot> {\n <a class=\"code-anchor\" href=\"api/router/RouterStateSnapshot#url\"><span class=\"member-name\">url</span>: string</a>\n <a class=\"code-anchor\" href=\"api/router/RouterStateSnapshot#toString\"><span class=\"member-name\">toString</span>(): string</a>\n}\n</activatedroutesnapshot></code-example>\n\n \n \n\n\n \n \n\n</section>\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/RouterStateSnapshot#description\"><i class=\"material-icons\">link</i></a></h2>\n <p>This is a tree of activated route snapshots. Every node in this tree knows about\nthe \"consumed\" URL segments, the extracted parameters, and the resolved data.</p>\n<p>The following example shows how a component is initialized with information\nfrom the snapshot of the root node's state at the time of creation.</p>\n<code-example>\n@<a href=\"api/core/Component\" class=\"code-anchor\">Component</a>({templateUrl:'template.html'})\nclass MyComponent {\n constructor(router: <a href=\"api/router/Router\" class=\"code-anchor\">Router</a>) {\n const <a href=\"api/animations/state\" class=\"code-anchor\">state</a>: <a href=\"api/router/RouterState\" class=\"code-anchor\">RouterState</a> = router.routerState;\n const snapshot: <a href=\"api/router/RouterStateSnapshot\" class=\"code-anchor\">RouterStateSnapshot</a> = state.snapshot;\n const root: <a href=\"api/router/ActivatedRouteSnapshot\" class=\"code-anchor\">ActivatedRouteSnapshot</a> = snapshot.root;\n const child = root.firstChild;\n const id: Observable<string> = child.params.map(p => p.id);\n //...\n }\n}\n</code-example>\n\n \n</section>\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/RouterStateSnapshot#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=\"url\"></a>\n <code class=\"\"><span class=\"member-name\">url</span>: string</code>\n </td>\n <td>\n \n <p>The url from which this snapshot was created</p>\n\n \n </td>\n </tr>\n \n </tbody>\n </table>\n</section>\n \n\n<section class=\"instance-methods\">\n <h2 id=\"methods\">Methods<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/router/RouterStateSnapshot#methods\"><i class=\"material-icons\">link</i></a></h2>\n \n <a id=\"toString\"></a>\n<table class=\"is-full-width method-table instance-method\">\n <thead><tr><th>\n <div class=\"with-github-links\">\n <h3 id=\"tostring\">\n toString()\n \n <a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/router/RouterStateSnapshot#tostring\"><i class=\"material-icons\">link</i></a></h3>\n <div class=\"github-links\">\n <a href=\"https://github.com/angular/angular/edit/master/packages/router/src/router_state.ts?message=docs(router)%3A%20describe%20your%20change...#L419-L422\" 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_state.ts#L419-L422\" aria-label=\"View Source\" title=\"View Source\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">code</i></a>\n</div>\n </div>\n </th></tr></thead>\n <tbody>\n \n \n <tr>\n <td>\n <div class=\"overload-info\">\n \n\n <code-example language=\"ts\" hidecopy=\"true\" class=\"no-box api-heading\"><span class=\"member-name\">toString</span>(): string</code-example>\n\n \n\n <h6 class=\"no-anchor\" id=\"parameters\">Parameters</h6>\n <p>There are no parameters.</p>\n\n \n <h6 class=\"no-anchor\" id=\"returns\">Returns</h6>\n <p><code>string</code></p>\n\n \n\n\n \n\n \n</div>\n </td>\n </tr>\n \n\n \n\n \n </tbody>\n</table>\n\n \n</section>\n\n\n \n\n\n </div>\n</article>\n\n<!-- links to this doc:\n - api/router\n - api/router/CanActivate\n - api/router/CanActivateChild\n - api/router/CanDeactivate\n - api/router/GuardsCheckEnd\n - api/router/GuardsCheckStart\n - api/router/Resolve\n - api/router/ResolveEnd\n - api/router/ResolveStart\n - api/router/RouterState\n - api/router/RoutesRecognized\n - guide/lazy-loading-ngmodules\n - guide/router\n - guide/router-tutorial-toh\n-->\n<!-- links from this doc:\n - /api\n - api/animations/state\n - api/core/Component\n - api/router\n - api/router/ActivatedRouteSnapshot\n - api/router/Router\n - api/router/RouterState\n - api/router/RouterStateSnapshot#description\n - api/router/RouterStateSnapshot#methods\n - api/router/RouterStateSnapshot#properties\n - api/router/RouterStateSnapshot#routerstatesnapshot\n - api/router/RouterStateSnapshot#toString\n - api/router/RouterStateSnapshot#tostring\n - api/router/RouterStateSnapshot#url\n - https://github.com/angular/angular/edit/master/packages/router/src/router_state.ts?message=docs(router)%3A%20describe%20your%20change...#L383-L423\n - https://github.com/angular/angular/edit/master/packages/router/src/router_state.ts?message=docs(router)%3A%20describe%20your%20change...#L419-L422\n - https://github.com/angular/angular/tree/12.0.0-next.7/packages/router/src/router_state.ts#L383-L423\n - https://github.com/angular/angular/tree/12.0.0-next.7/packages/router/src/router_state.ts#L419-L422\n-->"
|
|
} |