RouterLinkActive class

Adds a CSS class to the bound element when the link's route becomes active.

<a routerLink="/user/bob" routerLinkActive="active-link">Bob</a>

May also be used on an element containing a RouterLink.

<div routerLinkActive="active-link">
  <a routerLink="/user/bob">Bob</a>
</div>
Annotations
  • @Directive(selector: '[routerLinkActive]')

Constructors

RouterLinkActive(Element _element, Router _router)

Properties

hashCode int
The hash code for this object.
no setterinherited
getter/setter pair
routerLinkActive Object
no getter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

ngAfterViewInit() → void
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
toString() String
A string representation of this object.
inherited

Operators

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