diff --git a/modules/angular2/src/router/router_link.ts b/modules/angular2/src/router/router_link.ts index 69878ca3be..75337a92ea 100644 --- a/modules/angular2/src/router/router_link.ts +++ b/modules/angular2/src/router/router_link.ts @@ -33,7 +33,8 @@ import {Location} from './location'; @Directive({ selector: '[router-link]', properties: ['route: routerLink', 'params: routerParams'], - lifecycle: [onAllChangesDone] + lifecycle: [onAllChangesDone], + hostListeners: {'^click': 'onClick()'} }) export class RouterLink { private _domEl; @@ -48,16 +49,17 @@ export class RouterLink { constructor(elementRef: ElementRef, private _router: Router, private _location: Location) { this._domEl = elementRef.domElement; this._params = StringMapWrapper.create(); - DOM.on(this._domEl, 'click', (evt) => { - DOM.preventDefault(evt); - this._router.navigate(this._navigationHref); - }); } set route(changes: string) { this._route = changes; } set params(changes: StringMap) { this._params = changes; } + onClick() { + this._router.navigate(this._navigationHref); + return false; + } + onAllChangesDone(): void { if (isPresent(this._route) && isPresent(this._params)) { this._navigationHref = this._router.generate(this._route, this._params);