From 665ccafd73ea8dda92afd96995b0d6746d19a651 Mon Sep 17 00:00:00 2001 From: Marc Laval Date: Thu, 21 May 2015 11:51:48 +0200 Subject: [PATCH] fix(browser_adapter): event creation fails (IE11, Firefox) --- modules/angular2/src/dom/browser_adapter.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/angular2/src/dom/browser_adapter.ts b/modules/angular2/src/dom/browser_adapter.ts index 181e6a9a26..08d1944f2b 100644 --- a/modules/angular2/src/dom/browser_adapter.ts +++ b/modules/angular2/src/dom/browser_adapter.ts @@ -70,12 +70,14 @@ dispatchEvent(el, evt) { el.dispatchEvent(evt); } createMouseEvent(eventType: string): MouseEvent { - var evt: MouseEvent = new MouseEvent(eventType); + var evt: MouseEvent = document.createEvent('MouseEvent'); evt.initEvent(eventType, true, true); return evt; } createEvent(eventType): Event { - return new Event(eventType, true); + var evt: Event = document.createEvent('Event'); + evt.initEvent(eventType, true, true); + return evt; } preventDefault(evt: Event) { evt.preventDefault();