RouterLink class

Creates a listener on the target element that routes to a specified link.

<a routerLink="/heroes">Heroes</a>

Can also be used with RouterPath.

<a [routerLink]="heroPath.toUrl()">Heroes</a>

The routerLink can contain queryParameters or a fragment, ie: /heroes?a=1.

Annotations
  • @Directive(selector: '[routerLink]')

Constructors

Properties

hashCode int
The hash code for this object.
no setterinherited
no getter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
url → Url
no setter
visibleHref String
Indicates the URL when the hovering on the link.
no setter

Methods

ngOnDestroy() → void
Executed before the directive is removed from the DOM and destroyed.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onClick(MouseEvent event) → void
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited