RouterLinkWithHref
When applied to an element in a template, makes that element a link
that initiates navigation to a route. Navigation opens one or more routed components
in one or more <router-outlet>
locations on the page.
class RouterLinkWithHref implements OnChanges ,OnDestroy {}
href
string | null
Represents an href
attribute value applied to a host element,
when a host element is <a>
. For other tags, the value is null
.
target
string | undefined
Represents the target
attribute on a host element.
This is only used when the host element is an <a>
tag.
queryParams
Params | null | undefined
Passed to Router#createUrlTree
as part of the
UrlCreationOptions
.
fragment
string | undefined
Passed to Router#createUrlTree
as part of the
UrlCreationOptions
.
queryParamsHandling
QueryParamsHandling | null | undefined
Passed to Router#createUrlTree
as part of the
UrlCreationOptions
.
state
{ [k: string]: any; } | undefined
Passed to Router#navigateByUrl
as part of the
NavigationBehaviorOptions
.
info
unknown
Passed to Router#navigateByUrl
as part of the
NavigationBehaviorOptions
.
relativeTo
ActivatedRoute | null | undefined
Passed to Router#createUrlTree
as part of the
UrlCreationOptions
.
Specify a value here when you do not want to use the default value
for routerLink
, which is the current activated route.
Note that a value of undefined
here will use the routerLink
default.
preserveFragment
boolean
Passed to Router#createUrlTree
as part of the
UrlCreationOptions
.
skipLocationChange
boolean
Passed to Router#navigateByUrl
as part of the
NavigationBehaviorOptions
.
replaceUrl
boolean
Passed to Router#navigateByUrl
as part of the
NavigationBehaviorOptions
.
ngOnChanges
void
void
routerLink
string | any[] | UrlTree | null | undefined
Commands to pass to Router#createUrlTree
or a UrlTree
.
- array: commands to pass to
Router#createUrlTree
. - string: shorthand for array of commands with just the string, i.e.
['/route']
- UrlTree: a
UrlTree
for this link rather than creating one from the commands and other inputs that correspond to properties ofUrlCreationOptions
. - null|undefined: effectively disables the
routerLink
onClick
boolean
number
boolean
boolean
boolean
boolean
boolean
ngOnDestroy
any
any
urlTree
UrlTree | null