【问题标题】:Angular 2 application does not works properly in Internet explore, but works well with other browsersAngular 2 应用程序在 Internet Explorer 中无法正常运行,但在其他浏览器中运行良好
【发布时间】:2020-01-30 18:43:09
【问题描述】:

我的 Angular 应用程序适用于除 Internet Explorer 之外的所有网络浏览器。它在控制台中显示此错误。

polypills.ts 看起来像这样,

 * BROWSER POLYFILLS
 */

/** IE9, IE10 and IE11 requires all of the following polyfills. **/
import 'core-js/es6/object';
import 'core-js/es6/function';
 import 'core-js/es6/number';
import 'core-js/es6/string';
import 'core-js/es6/array';

/** Evergreen browsers require these. **/
// Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove.
import 'core-js/es7/reflect';

(window as any).__Zone_enable_cross_context_check = true;

【问题讨论】:

标签: javascript angular internet-explorer-11


【解决方案1】:

因为Angular 2 / 4 / 5 not working in IE11的答案

没有和我一起工作,我发现问题不在于 polyfills。错误来自使用 IE 不支持的语法的新 java-script 函数。仅适用于 chrome 等浏览器。我将语法更改为旧版本并修复了该问题。现在也可以在 IE 上正常工作。

【讨论】:

  • 这些错误在 IE 控制台中显示为语法错误。
猜你喜欢
  • 2013-09-23
  • 2012-02-07
  • 2023-04-01
  • 2011-04-15
  • 1970-01-01
  • 2016-09-12
  • 1970-01-01
  • 2020-06-10
  • 1970-01-01
相关资源
最近更新 更多