2017-10-10 90 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';

相关问题