fix(router): fix RouterLinKActive to work with RouterLink

This commit is contained in:
vsavkin
2016-07-07 15:29:54 -07:00
parent 93025d1bc6
commit f7a0e9ecb6
2 changed files with 20 additions and 16 deletions

View File

@ -62,8 +62,6 @@ export class RouterLink {
@Input() queryParams: {[k: string]: any};
@Input() fragment: string;
urlTree: UrlTree;
constructor(
private router: Router, private route: ActivatedRoute,
private locationStrategy: LocationStrategy) {}
@ -82,14 +80,14 @@ export class RouterLink {
if (button !== 0 || ctrlKey || metaKey) {
return true;
}
this.router.navigateByUrl(this.urlTree);
return false;
}
this.urlTree = this.router.createUrlTreeUsingFutureUrl(
get urlTree(): UrlTree {
return this.router.createUrlTreeUsingFutureUrl(
this.commands,
{relativeTo: this.route, queryParams: this.queryParams, fragment: this.fragment});
this.router.navigateByUrl(this.urlTree);
return false;
}
}