From 8e221b826f12f6a3832baa639c0a17e0ed4782f8 Mon Sep 17 00:00:00 2001 From: vsavkin Date: Tue, 1 Nov 2016 14:35:41 -0700 Subject: [PATCH] fix(router): routerLink should not prevent default on non-link elements --- modules/@angular/router/src/directives/router_link.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/modules/@angular/router/src/directives/router_link.ts b/modules/@angular/router/src/directives/router_link.ts index b21718d8ed..0df77682ef 100644 --- a/modules/@angular/router/src/directives/router_link.ts +++ b/modules/@angular/router/src/directives/router_link.ts @@ -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 {