0

IE11의 각도 4에서 mouseEvent에 문제가 있습니다. 각도 4, 각도 cli를 사용하고 있습니다.각도 4 - 새 MouseEvent로 인해 IE11 오류가 발생합니다.

내가 코드 줄을 활성화하면 :

let newEvent = new MouseEvent('mouseleave', {bubbles: true}); 

IE 콘솔에서 이러한 예외를 던지고있다 :

TypeError: Object does not support this operation. 
    at MenuItemComponent.prototype.onClick (./main.bundle.js:821:13) 
    at Anonymous function (Function code:37:9) 
    at handleEvent (./vendor.bundle.js:12039:87) 
    at callWithDebugContext (./vendor.bundle.js:13247:9) 
    at debugHandleEvent (./vendor.bundle.js:12835:5) 
    at dispatchEvent (./vendor.bundle.js:9014:5) 
    at Anonymous function (./vendor.bundle.js:9604:31) 
    at Anonymous function (./vendor.bundle.js:19253:9) 
    at ZoneDelegate.prototype.invokeTask (./polyfills.bundle.js:10732:13) 
    at onInvokeTask (./vendor.bundle.js:4357:21) 
    at ZoneDelegate.prototype.invokeTask (./polyfills.bundle.js:10732:13) 
    at Zone.prototype.runTask (./polyfills.bundle.js:10501:21) 
    at invoke (./polyfills.bundle.js:10796:21) 

내가 내 polyfils.ts 및 rebuilded 프로젝트에 모든 것을 주석 처리, 나는 IE와 ES6 shims를 시도했다 ...

나는 무엇이에 찾을 수 없다 Google, 그리고 이것이 바보 같은 문제라고 생각합니다. 클라우드 누군가가 해결책을 가르쳐 주시겠습니까?

+0

그것은이 될 수 있을까? http://stackoverflow.com/questions/1368536/internet-explorer-says-object-doesnt-support-this-property-or-method –

+0

아니요, 전체 페이지에는 ID가 없습니다. :) –

답변

0
당신은에 의해 IE에 대한 속일 수

:

수입에서 {구성 요소,하는 OnInit,하여 elementRef, ViewChild} '@/핵심 각도';

...

@ViewChild ('fileinput 함수') 공공 fileinput 함수 :하여 elementRef;

은 ...

// Trigger button click event 
let event; 
if (document.createEvent){ 
    // Only for IE and Firefox 
    event = document.createEvent('MouseEvent'); 
    event.initMouseEvent('click', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); 
} else { 
    // For Chrome 
    event = new MouseEvent('click', {bubbles: false}); 
} 
this.button.nativeElement.dispatchEvent(event);