2017-12-27 37 views
0

私のangular2アプリケーションは例外をスローしますオブジェクトはこの動作をサポートしていません Microsoftエッジでのみ。下の画像をご確認ください:Angular2:オブジェクトはMicrosoft Edgeブラウザでこのアクションをサポートしていません

enter image description here

enter image description here

私はデバッグおよび例外は、コードそして約束で投げられることがわかりました。

this.dataLayerService 
      .postLogin(this.model, this.postURL) 
      .then(usermasterResponse => this.setToken(usermasterResponse)) 
      .catch(error => { 
        this.toastCommunicationService.setMessage(error, "", 
        this.toastCommunicationService.errorType) 
      }); 

私もindex.htmlファイル内のスクリプトの下に追加されているが、それは無駄でもありました。具体的には、私は以下のコードで、その後にエラーを取得しています。

<script src="https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.34.1/es6-shim.js"></script> 

ご協力いただければ幸いです。

ありがとうございます。

答えて

0

問題は、以下のコードでのEventSourceしていました:

this.eventsource = new EventSource(this.configService.get("BaseURL")); 

は、私はそれがイベントソースポリフィルJSを追加することで解決しまいました。私はこのEventSource Polyfillのリンクに従ってjsをインストールします。

ありがとうございました。

0

があなたのindex.html で<meta http-equiv="x-ua-compatible" content="ie=edge">を入れても、あなたの角度のプロジェクトフォルダとインポートであなたのpolyfills.tsファイルを検索し、あなたのpolyfillsスクリプトをチェックし、すべてのコア-JS/ES6 /スクリプト

+0

polyfill.tsファイルが見つかりませんでした。お手伝いできますか? –

+0

あなたはどのようにあなたのアプリを始めましたか? 角度スタータープロジェクトでは? –

+0

とにかく、srcフォルダの下にmain.tsとpolyfills.tsを置いてください。 –

0

をインポートし、次の行:

/** IE9, IE10 and IE11 requires all of the following polyfills. **/ 
import 'core-js/es6/symbol'; 
import 'core-js/es6/object'; 
import 'core-js/es7/object'; 
import 'core-js/es6/function'; 
import 'core-js/es6/parse-int'; 
import 'core-js/es6/parse-float'; 
import 'core-js/es6/number'; 
import 'core-js/es6/math'; 
import 'core-js/es6/string'; 
import 'core-js/es6/date'; 
import 'core-js/es6/array'; 
import 'core-js/es6/regexp'; 
import 'core-js/es6/map'; 
import 'core-js/es6/set'; 
import 'core-js/es7/array'; 

あなたは、Webアニメーションを使用しているので、あなたはこの必要がある場合:常緑ブラウザYの

/** IE10 and IE11 requires the following to support `@angular/animation`. */ 
import 'web-animations-js'; // Run `npm install --save web-animations-js`. 

を私たちの必要性この:

/** Evergreen browsers require these. **/ 
import 'core-js/es6/reflect'; 
import 'core-js/es7/reflect'; 

エバーグリーンブラウザの定義(original):

クロム、Firefox、Internet Explorer、Safariの最新バージョンは、すなわち、彼らが自動的にユーザーにメッセージを表示せずに静かに自分自身を更新し、常緑のブラウザです。 Internet Explorerの場合、ほとんどの人はこれをIE10 +と見なします。

+0

はpolyfill.tsファイルを見つけることができませんでした。私を助けてください。 –

関連する問題