5 lines
10 KiB
JSON
5 lines
10 KiB
JSON
{
|
|
"id": "api/router/UrlTree",
|
|
"title": "UrlTree",
|
|
"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/UrlTree\", \"name\": \"UrlTree\" } }\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/url_tree.ts?message=docs(router)%3A%20describe%20your%20change...#L158-L214\" 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/url_tree.ts#L158-L214\" 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=\"urltree\">UrlTree<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/router/UrlTree#urltree\"><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 parsed URL.</p>\n\n <p><a href=\"api/router/UrlTree#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/UrlTree\" class=\"code-anchor\">UrlTree</a> {\n <a class=\"code-anchor\" href=\"api/router/UrlTree#root\"><span class=\"member-name\">root</span>: UrlSegmentGroup</a>\n <a class=\"code-anchor\" href=\"api/router/UrlTree#queryParams\"><span class=\"member-name\">queryParams</span>: Params</a>\n <a class=\"code-anchor\" href=\"api/router/UrlTree#fragment\"><span class=\"member-name\">fragment</span>: string | null</a>\n <a class=\"code-anchor\" href=\"api/router/UrlTree#queryParamMap\"><span class=\"member-name\">queryParamMap</span>: ParamMap</a>\n <a class=\"code-anchor\" href=\"api/router/UrlTree#toString\"><span class=\"member-name\">toString</span>(): string</a>\n}\n</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/UrlTree#description\"><i class=\"material-icons\">link</i></a></h2>\n <p>Since a router state is a tree, and the URL is nothing but a serialized state, the URL is a\nserialized tree.\nUrlTree is a data structure that provides a lot of affordances in dealing with URLs</p>\n\n <p>Further information available in the <a href=\"api/router/UrlTree#usage-notes\">Usage Notes</a>...</p>\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/UrlTree#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=\"root\"></a>\n <code class=\"\"><span class=\"member-name\">root</span>: <a href=\"api/router/UrlSegmentGroup\" class=\"code-anchor\">UrlSegmentGroup</a></code>\n </td>\n <td>\n \n <p>The root segment group of the URL tree</p>\n\n \n </td>\n </tr>\n \n <tr class=\"instance-property\">\n <td>\n <a id=\"queryParams\"></a>\n <code class=\"\"><span class=\"member-name\">queryParams</span>: <a href=\"api/router/Params\" class=\"code-anchor\">Params</a></code>\n </td>\n <td>\n \n <p>The query params of the URL</p>\n\n \n </td>\n </tr>\n \n <tr class=\"instance-property\">\n <td>\n <a id=\"fragment\"></a>\n <code class=\"\"><span class=\"member-name\">fragment</span>: string | null</code>\n </td>\n <td>\n \n <p>The fragment of the URL</p>\n\n \n </td>\n </tr>\n \n <tr class=\"instance-property\">\n <td>\n <a id=\"queryParamMap\"></a>\n <code class=\"\"><span class=\"member-name\">queryParamMap</span>: <a href=\"api/router/ParamMap\" class=\"code-anchor\">ParamMap</a></code>\n </td>\n <td><span class=\"read-only-property\">Read-Only</span>\n \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/UrlTree#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/UrlTree#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/url_tree.ts?message=docs(router)%3A%20describe%20your%20change...#L209-L213\" 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/url_tree.ts#L209-L213\" 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<section class=\"usage-notes\">\n <h2 id=\"usage-notes\">Usage notes<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/router/UrlTree#usage-notes\"><i class=\"material-icons\">link</i></a></h2>\n <h3 id=\"example\">Example<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/router/UrlTree#example\"><i class=\"material-icons\">link</i></a></h3>\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 tree: <a href=\"api/router/UrlTree\" class=\"code-anchor\">UrlTree</a> =\n router.parseUrl('/team/33/(user/victor//support:help)?debug=true#fragment');\n const f = tree.fragment; // return 'fragment'\n const q = tree.queryParams; // returns {debug: 'true'}\n const g: <a href=\"api/router/UrlSegmentGroup\" class=\"code-anchor\">UrlSegmentGroup</a> = tree.root.children[<a href=\"api/router/PRIMARY_OUTLET\" class=\"code-anchor\">PRIMARY_OUTLET</a>];\n const s: <a href=\"api/router/UrlSegment\" class=\"code-anchor\">UrlSegment</a>[] = g.segments; // returns 2 segments 'team' and '33'\n g.children[<a href=\"api/router/PRIMARY_OUTLET\" class=\"code-anchor\">PRIMARY_OUTLET</a>].segments; // returns 2 segments 'user' and 'victor'\n g.children['support'].segments; // return 1 segment 'help'\n }\n}\n</code-example>\n\n</section>\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/CanLoad\n - api/router/DefaultUrlSerializer\n - api/router/ExtraOptions\n - api/router/IsActiveMatchOptions\n - api/router/Navigation\n - api/router/NavigationCancel\n - api/router/Router\n - api/router/RouterLink\n - api/router/RouterLinkWithHref\n - api/router/UrlHandlingStrategy\n - api/router/UrlSegment\n - api/router/UrlSegmentGroup\n - api/router/UrlSerializer\n - guide/router\n - guide/router-tutorial-toh\n-->\n<!-- links from this doc:\n - /api\n - api/core/Component\n - api/router\n - api/router/PRIMARY_OUTLET\n - api/router/ParamMap\n - api/router/Params\n - api/router/Router\n - api/router/UrlSegment\n - api/router/UrlSegmentGroup\n - api/router/UrlTree#description\n - api/router/UrlTree#example\n - api/router/UrlTree#fragment\n - api/router/UrlTree#methods\n - api/router/UrlTree#properties\n - api/router/UrlTree#queryParamMap\n - api/router/UrlTree#queryParams\n - api/router/UrlTree#root\n - api/router/UrlTree#toString\n - api/router/UrlTree#tostring\n - api/router/UrlTree#urltree\n - api/router/UrlTree#usage-notes\n - https://github.com/angular/angular/edit/master/packages/router/src/url_tree.ts?message=docs(router)%3A%20describe%20your%20change...#L158-L214\n - https://github.com/angular/angular/edit/master/packages/router/src/url_tree.ts?message=docs(router)%3A%20describe%20your%20change...#L209-L213\n - https://github.com/angular/angular/tree/12.0.0-next.7/packages/router/src/url_tree.ts#L158-L214\n - https://github.com/angular/angular/tree/12.0.0-next.7/packages/router/src/url_tree.ts#L209-L213\n-->"
|
|
} |