fix(router): routerLink should not prevent default on non-link elements
This commit is contained in:
parent
830a780cb3
commit
8e221b826f
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue