Skip to content

Commit

Permalink
fixup! feat(router): new output that would notify when link is activated
Browse files Browse the repository at this point in the history
  • Loading branch information
anandtiwary authored and atscott committed Aug 31, 2021
1 parent ff004a6 commit 31a1118
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions packages/router/src/directives/router_link_active.ts
Expand Up @@ -72,16 +72,6 @@ import {RouterLink, RouterLinkWithHref} from './router_link';
* </div>
* ```
*
* You can use the output `isActiveChange` to get notified each time the link becomes
* active or inactive.
*
* ```
* <a
* routerLink="/user/bob"
* routerLinkActive="active-link"
* (isActiveChange)="this.onRouterLinkActive($event)">Bob</a>
* ```
*
* @ngModule RouterModule
*
* @publicApi
Expand Down Expand Up @@ -109,6 +99,22 @@ export class RouterLinkActive implements OnChanges, OnDestroy, AfterContentInit
*/
@Input() routerLinkActiveOptions: {exact: boolean}|IsActiveMatchOptions = {exact: false};

/**
*
* You can use the output `isActiveChange` to get notified each time the link becomes
* active or inactive.
*
* Emits:
* true -> Route is active
* false -> Route is inactive
*
* ```
* <a
* routerLink="/user/bob"
* routerLinkActive="active-link"
* (isActiveChange)="this.onRouterLinkActive($event)">Bob</a>
* ```
*/
@Output() readonly isActiveChange: EventEmitter<boolean> = new EventEmitter();

constructor(
Expand Down

0 comments on commit 31a1118

Please sign in to comment.