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

@ContentChildren(RouterLink), read / write
routerLinkActive Object
@Input(), write-only
hashCode → int
The hash code for this object. [...]
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited

Methods

ngAfterViewInit() → void
ngOnDestroy() → void
Executed before the directive is removed from the DOM and destroyed. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() → String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) → bool
The equality operator. [...]
inherited