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

5 lines
15 KiB
JSON

{
"id": "api/router/RouterLinkWithHref",
"title": "RouterLinkWithHref",
"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/RouterLinkWithHref\", \"name\": \"RouterLinkWithHref\" } }\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/directives/router_link.ts?message=docs(router)%3A%20describe%20your%20change...#L244-L409\" 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/directives/router_link.ts#L244-L409\" 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=\"routerlinkwithhref\">RouterLinkWithHref<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/router/RouterLinkWithHref#routerlinkwithhref\"><i class=\"material-icons\">link</i></a></h1>\n \n <label class=\"api-type-label directive\">directive</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>Lets you link to specific routes in your app.</p>\n\n <p><a href=\"api/router/RouterLinkWithHref#description\">See more...</a></p>\n </section>\n \n \n \n \n\n <h2 id=\"ngmodule\">NgModule<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/router/RouterLinkWithHref#ngmodule\"><i class=\"material-icons\">link</i></a></h2>\n<ul class=\"ngmodule-list\">\n\n <li>\n <a href=\"api/router/RouterModule\">\n <code-example language=\"ts\" hidecopy=\"true\" class=\"no-box\">RouterModule</code-example>\n </a>\n </li>\n \n</ul>\n\n\n \n<section class=\"selector-list\">\n <h2 id=\"selectors\">Selectors<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/router/RouterLinkWithHref#selectors\"><i class=\"material-icons\">link</i></a></h2>\n \n <ul>\n <li><code>a[<a href=\"api/router/RouterLink\" class=\"code-anchor\">routerLink</a>]</code></li>\n \n <li><code><a href=\"api/router/RouterLinkWithHref\" class=\"code-anchor\">area</a>[<a href=\"api/router/RouterLink\" class=\"code-anchor\">routerLink</a>]</code></li>\n \n </ul>\n \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/RouterLinkWithHref#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=\"target\"></a>\n <code class=\"\"><span class=\"property-binding\">@<a href=\"api/core/Input\" class=\"code-anchor\">Input</a>()</span><br><span class=\"member-name\">target</span>: string</code>\n </td>\n <td>\n \n \n \n </td>\n </tr>\n \n <tr class=\"instance-property\">\n <td>\n <a id=\"queryParams\"></a>\n <code class=\"\"><span class=\"property-binding\">@<a href=\"api/core/Input\" class=\"code-anchor\">Input</a>()</span><br><span class=\"member-name\">queryParams</span>?: <a href=\"api/router/Params\" class=\"code-anchor\">Params</a> | null</code>\n </td>\n <td>\n \n <p>Passed to <a href=\"api/router/Router#createUrlTree\">Router#createUrlTree</a> as part of the\n<code><a href=\"api/router/UrlCreationOptions\" class=\"code-anchor\">UrlCreationOptions</a></code>.</p>\n\n \n <p>See also:</p>\n <ul>\n \n <li><a href=\"api/router/UrlCreationOptions#queryParams\">UrlCreationOptions#queryParams</a>\n</li>\n <li><a href=\"api/router/Router#createUrlTree\">Router#createUrlTree</a>\n</li>\n </ul>\n \n </td>\n </tr>\n \n <tr class=\"instance-property\">\n <td>\n <a id=\"fragment\"></a>\n <code class=\"\"><span class=\"property-binding\">@<a href=\"api/core/Input\" class=\"code-anchor\">Input</a>()</span><br><span class=\"member-name\">fragment</span>?: string</code>\n </td>\n <td>\n \n <p>Passed to <a href=\"api/router/Router#createUrlTree\">Router#createUrlTree</a> as part of the\n<code><a href=\"api/router/UrlCreationOptions\" class=\"code-anchor\">UrlCreationOptions</a></code>.</p>\n\n \n <p>See also:</p>\n <ul>\n \n <li><a href=\"api/router/UrlCreationOptions#fragment\">UrlCreationOptions#fragment</a>\n</li>\n <li><a href=\"api/router/Router#createUrlTree\">Router#createUrlTree</a>\n</li>\n </ul>\n \n </td>\n </tr>\n \n <tr class=\"instance-property\">\n <td>\n <a id=\"queryParamsHandling\"></a>\n <code class=\"\"><span class=\"property-binding\">@<a href=\"api/core/Input\" class=\"code-anchor\">Input</a>()</span><br><span class=\"member-name\">queryParamsHandling</span>?: <a href=\"api/router/QueryParamsHandling\" class=\"code-anchor\">QueryParamsHandling</a> | null</code>\n </td>\n <td>\n \n <p>Passed to <a href=\"api/router/Router#createUrlTree\">Router#createUrlTree</a> as part of the\n<code><a href=\"api/router/UrlCreationOptions\" class=\"code-anchor\">UrlCreationOptions</a></code>.</p>\n\n \n <p>See also:</p>\n <ul>\n \n <li><a href=\"api/router/UrlCreationOptions#queryParamsHandling\">UrlCreationOptions#queryParamsHandling</a>\n</li>\n <li><a href=\"api/router/Router#createUrlTree\">Router#createUrlTree</a>\n</li>\n </ul>\n \n </td>\n </tr>\n \n <tr class=\"instance-property\">\n <td>\n <a id=\"preserveFragment\"></a>\n <code class=\"\"><span class=\"property-binding\">@<a href=\"api/core/Input\" class=\"code-anchor\">Input</a>()</span><br><span class=\"member-name\">preserveFragment</span>: boolean</code>\n </td>\n <td>\n \n <p>Passed to <a href=\"api/router/Router#createUrlTree\">Router#createUrlTree</a> as part of the\n<code><a href=\"api/router/UrlCreationOptions\" class=\"code-anchor\">UrlCreationOptions</a></code>.</p>\n\n \n <p>See also:</p>\n <ul>\n \n <li><a href=\"api/router/UrlCreationOptions#preserveFragment\">UrlCreationOptions#preserveFragment</a>\n</li>\n <li><a href=\"api/router/Router#createUrlTree\">Router#createUrlTree</a>\n</li>\n </ul>\n \n </td>\n </tr>\n \n <tr class=\"instance-property\">\n <td>\n <a id=\"skipLocationChange\"></a>\n <code class=\"\"><span class=\"property-binding\">@<a href=\"api/core/Input\" class=\"code-anchor\">Input</a>()</span><br><span class=\"member-name\">skipLocationChange</span>: boolean</code>\n </td>\n <td>\n \n <p>Passed to <a href=\"api/router/Router#navigateByUrl\">Router#navigateByUrl</a> as part of the\n<code><a href=\"api/router/NavigationBehaviorOptions\" class=\"code-anchor\">NavigationBehaviorOptions</a></code>.</p>\n\n \n <p>See also:</p>\n <ul>\n \n <li><a href=\"api/router/NavigationBehaviorOptions#skipLocationChange\">NavigationBehaviorOptions#skipLocationChange</a>\n</li>\n <li><a href=\"api/router/Router#navigateByUrl\">Router#navigateByUrl</a>\n</li>\n </ul>\n \n </td>\n </tr>\n \n <tr class=\"instance-property\">\n <td>\n <a id=\"replaceUrl\"></a>\n <code class=\"\"><span class=\"property-binding\">@<a href=\"api/core/Input\" class=\"code-anchor\">Input</a>()</span><br><span class=\"member-name\">replaceUrl</span>: boolean</code>\n </td>\n <td>\n \n <p>Passed to <a href=\"api/router/Router#navigateByUrl\">Router#navigateByUrl</a> as part of the\n<code><a href=\"api/router/NavigationBehaviorOptions\" class=\"code-anchor\">NavigationBehaviorOptions</a></code>.</p>\n\n \n <p>See also:</p>\n <ul>\n \n <li><a href=\"api/router/NavigationBehaviorOptions#replaceUrl\">NavigationBehaviorOptions#replaceUrl</a>\n</li>\n <li><a href=\"api/router/Router#navigateByUrl\">Router#navigateByUrl</a>\n</li>\n </ul>\n \n </td>\n </tr>\n \n <tr class=\"instance-property\">\n <td>\n <a id=\"state\"></a>\n <code class=\"\"><span class=\"property-binding\">@<a href=\"api/core/Input\" class=\"code-anchor\">Input</a>()</span><br><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>Passed to <a href=\"api/router/Router#navigateByUrl\">Router#navigateByUrl</a> as part of the\n<code><a href=\"api/router/NavigationBehaviorOptions\" class=\"code-anchor\">NavigationBehaviorOptions</a></code>.</p>\n\n \n <p>See also:</p>\n <ul>\n \n <li><a href=\"api/router/NavigationBehaviorOptions#state\">NavigationBehaviorOptions#state</a>\n</li>\n <li><a href=\"api/router/Router#navigateByUrl\">Router#navigateByUrl</a>\n</li>\n </ul>\n \n </td>\n </tr>\n \n <tr class=\"instance-property\">\n <td>\n <a id=\"relativeTo\"></a>\n <code class=\"\"><span class=\"property-binding\">@<a href=\"api/core/Input\" class=\"code-anchor\">Input</a>()</span><br><span class=\"member-name\">relativeTo</span>?: <a href=\"api/router/ActivatedRoute\" class=\"code-anchor\">ActivatedRoute</a> | null</code>\n </td>\n <td>\n \n <p>Passed to <a href=\"api/router/Router#createUrlTree\">Router#createUrlTree</a> as part of the\n<code><a href=\"api/router/UrlCreationOptions\" class=\"code-anchor\">UrlCreationOptions</a></code>.\nSpecify a value here when you do not want to use the default value\nfor <code><a href=\"api/router/RouterLink\" class=\"code-anchor\">routerLink</a></code>, which is the current activated route.\nNote that a value of <code>undefined</code> here will use the <code><a href=\"api/router/RouterLink\" class=\"code-anchor\">routerLink</a></code> default.</p>\n\n \n <p>See also:</p>\n <ul>\n \n <li><a href=\"api/router/UrlCreationOptions#relativeTo\">UrlCreationOptions#relativeTo</a>\n</li>\n <li><a href=\"api/router/Router#createUrlTree\">Router#createUrlTree</a>\n</li>\n </ul>\n \n </td>\n </tr>\n \n <tr class=\"instance-property\">\n <td>\n <a id=\"href\"></a>\n <code class=\"\"><span class=\"member-name\">href</span>: string</code>\n </td>\n <td>\n \n \n \n </td>\n </tr>\n \n <tr class=\"instance-property\">\n <td>\n <a id=\"routerLink\"></a>\n <code class=\"\"><span class=\"property-binding\">@<a href=\"api/core/Input\" class=\"code-anchor\">Input</a>()</span><br><span class=\"member-name\"><a href=\"api/router/RouterLink\" class=\"code-anchor\">routerLink</a></span>: string | any[]</code>\n </td>\n <td><span class=\"write-only-property\">Write-Only</span>\n \n <p>Commands to pass to <a href=\"api/router/Router#createUrlTree\">Router#createUrlTree</a>.</p>\n<ul>\n<li><strong>array</strong>: commands to pass to <a href=\"api/router/Router#createUrlTree\">Router#createUrlTree</a>.</li>\n<li><strong>string</strong>: shorthand for array of commands with just the string, i.e. <code>['/route']</code></li>\n<li><strong>null|undefined</strong>: shorthand for an empty array of commands, i.e. <code>[]</code></li>\n</ul>\n\n \n <p>See also:</p>\n <ul>\n \n <li><a href=\"api/router/Router#createUrlTree\">Router#createUrlTree</a>\n</li>\n </ul>\n \n </td>\n </tr>\n \n <tr class=\"instance-property\">\n <td>\n <a id=\"urlTree\"></a>\n <code class=\"\"><span class=\"member-name\">urlTree</span>: <a href=\"api/router/UrlTree\" class=\"code-anchor\">UrlTree</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\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/RouterLinkWithHref#description\"><i class=\"material-icons\">link</i></a></h2>\n <p>See <code><a href=\"api/router/RouterLink\" class=\"code-anchor\">RouterLink</a></code> for more information.</p>\n\n \n </section>\n \n\n \n\n \n\n \n\n \n \n \n\n </div>\n</article>\n\n<!-- links to this doc:\n - api/common/DatePipe\n - api/common/KeyValuePipe\n - api/core/OnChanges\n - api/core/OnDestroy\n - api/router\n - api/router/RouterLink\n - api/router/RouterLinkActive\n - api/router/RouterModule\n - guide/cheatsheet\n-->\n<!-- links from this doc:\n - /api\n - api/animations/state\n - api/core/Input\n - api/router\n - api/router/ActivatedRoute\n - api/router/NavigationBehaviorOptions\n - api/router/NavigationBehaviorOptions#replaceUrl\n - api/router/NavigationBehaviorOptions#skipLocationChange\n - api/router/NavigationBehaviorOptions#state\n - api/router/Params\n - api/router/QueryParamsHandling\n - api/router/Router#createUrlTree\n - api/router/Router#navigateByUrl\n - api/router/RouterLink\n - api/router/RouterLinkWithHref#description\n - api/router/RouterLinkWithHref#ngmodule\n - api/router/RouterLinkWithHref#properties\n - api/router/RouterLinkWithHref#routerlinkwithhref\n - api/router/RouterLinkWithHref#selectors\n - api/router/RouterModule\n - api/router/UrlCreationOptions\n - api/router/UrlCreationOptions#fragment\n - api/router/UrlCreationOptions#preserveFragment\n - api/router/UrlCreationOptions#queryParams\n - api/router/UrlCreationOptions#queryParamsHandling\n - api/router/UrlCreationOptions#relativeTo\n - api/router/UrlTree\n - https://github.com/angular/angular/edit/master/packages/router/src/directives/router_link.ts?message=docs(router)%3A%20describe%20your%20change...#L244-L409\n - https://github.com/angular/angular/tree/12.0.0-next.7/packages/router/src/directives/router_link.ts#L244-L409\n-->"
}