2017-10-10 57 views
0

我已經開始學習Angular 4並使用Angular CLI (NG New HelloWorld)編寫了一個默認應用程序。當我寫ng serve,並瀏覽到http://localhost:4200/,頁面加載罰款Chrome,但在IE-Edge,它打開爲一個空白頁面。在IE的控制檯窗口中有一個錯誤,它是SCRIPT5022: Exception thrown and not caught File: polyfills.bundle.js, Line: 859, Column: 36。 這是預期的嗎?在IE中的角度應用程序空白頁面,但在Chrome中工作

Screenshot of Empty Page in Internet Explorer

Internet Explorer = Edge

Screenshot of How it loads in Chrome

Chrome

+0

可能不正常......調試工具是否有任何控制檯錯誤報告? – pixelbits

+0

對不起,控制檯窗口中出現錯誤:引發異常並未捕獲:polyfills.bundle.js – Baahubali

+0

錯誤消息是什麼? – pixelbits

回答

1

發現我的答案在這裏:

Angular4 Application running issues in IE11

轉到Polyfills.js文件src文件夾下,並然後根據該文件中的說明,取消註釋以下幾行:

/** IE9, IE10 and IE11 requires all of the following polyfills. **/ import 'core-js/es6/symbol'; import 'core-js/es6/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';

相關問題