fix(router): routerLink should not prevent default on non-link elements

This commit is contained in:
vsavkin 2016-11-01 14:35:41 -07:00
parent 830a780cb3
commit 8e221b826f
1 changed files with 3 additions and 6 deletions

View File

@ -108,13 +108,10 @@ export class RouterLink {
}
}
@HostListener('click', ['$event.button', '$event.ctrlKey', '$event.metaKey'])
onClick(button: number, ctrlKey: boolean, metaKey: boolean): boolean {
if (button !== 0 || ctrlKey || metaKey) {
return true;
}
@HostListener('click', [])
onClick(): boolean {
this.router.navigateByUrl(this.urlTree);
return false;
return true;
}
get urlTree(): UrlTree {