{ "id": "api/router/RouterLinkWithHref", "title": "RouterLinkWithHref", "contents": "\n\n
\n
\n
\n \n API > @angular/router\n
\n \n
\n \n
\n

RouterLinkWithHreflink

\n \n \n \n \n \n
\n \n \n\n
\n \n
\n

Lets you link to specific routes in your app.

\n\n

See more...

\n
\n \n \n \n \n\n

NgModulelink

\n\n\n\n \n
\n

Selectorslink

\n \n \n \n
\n\n\n\n \n\n
\n

Propertieslink

\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
PropertyDescription
\n \n @Input()
target: string
\n
\n \n \n \n
\n \n @Input()
queryParams?: Params | null
\n
\n \n

Passed to Router#createUrlTree as part of the\nUrlCreationOptions.

\n\n \n

See also:

\n \n \n
\n \n @Input()
fragment?: string
\n
\n \n

Passed to Router#createUrlTree as part of the\nUrlCreationOptions.

\n\n \n

See also:

\n \n \n
\n \n @Input()
queryParamsHandling?: QueryParamsHandling | null
\n
\n \n

Passed to Router#createUrlTree as part of the\nUrlCreationOptions.

\n\n \n

See also:

\n \n \n
\n \n @Input()
preserveFragment: boolean
\n
\n \n

Passed to Router#createUrlTree as part of the\nUrlCreationOptions.

\n\n \n

See also:

\n \n \n
\n \n @Input()
skipLocationChange: boolean
\n
\n \n

Passed to Router#navigateByUrl as part of the\nNavigationBehaviorOptions.

\n\n \n

See also:

\n \n \n
\n \n @Input()
replaceUrl: boolean
\n
\n \n

Passed to Router#navigateByUrl as part of the\nNavigationBehaviorOptions.

\n\n \n

See also:

\n \n \n
\n \n @Input()
state?: {\n [k: string]: any;\n}
\n
\n \n

Passed to Router#navigateByUrl as part of the\nNavigationBehaviorOptions.

\n\n \n

See also:

\n \n \n
\n \n @Input()
relativeTo?: ActivatedRoute | null
\n
\n \n

Passed to Router#createUrlTree as part of the\nUrlCreationOptions.\nSpecify a value here when you do not want to use the default value\nfor routerLink, which is the current activated route.\nNote that a value of undefined here will use the routerLink default.

\n\n \n

See also:

\n \n \n
\n \n href: string\n \n \n \n \n
\n \n @Input()
routerLink: string | any[]
\n
Write-Only\n \n

Commands to pass to Router#createUrlTree.

\n
    \n
  • array: commands to pass to Router#createUrlTree.
  • \n
  • string: shorthand for array of commands with just the string, i.e. ['/route']
  • \n
  • null|undefined: shorthand for an empty array of commands, i.e. []
  • \n
\n\n \n

See also:

\n \n \n
\n \n urlTree: UrlTree\n Read-Only\n \n \n \n
\n
\n\n\n\n \n\n\n \n
\n

Descriptionlink

\n

See RouterLink for more information.

\n\n \n
\n \n\n \n\n \n\n \n\n \n \n \n\n
\n
\n\n\n" }