fix(router): router link active should take all descendants into account

This commit is contained in:
vsavkin
2016-07-22 16:42:05 -07:00
parent 93a4ca652a
commit 8d90a5a4cf
2 changed files with 41 additions and 37 deletions

View File

@ -59,8 +59,9 @@ import {RouterLink, RouterLinkWithHref} from './router_link';
*/
@Directive({selector: '[routerLinkActive]'})
export class RouterLinkActive implements OnChanges, OnDestroy, AfterContentInit {
@ContentChildren(RouterLink) links: QueryList<RouterLink>;
@ContentChildren(RouterLinkWithHref) linksWithHrefs: QueryList<RouterLinkWithHref>;
@ContentChildren(RouterLink, {descendants: true}) links: QueryList<RouterLink>;
@ContentChildren(RouterLinkWithHref, {descendants: true})
linksWithHrefs: QueryList<RouterLinkWithHref>;
private classes: string[] = [];
private subscription: Subscription;