首页 > 解决方案 > Angular 7 和 IE

问题描述

查看角度应用程序时,我在 IE 11 中遇到此错误

SCRIPT445: Object doesn't support this action
zone.js (199,1)

if (this._zoneDelegate.handleError(this, error)) {
    throw error;
}

使用 Angular Core 7.2.15 和我使用的 polyfill

import 'core-js/es6/symbol';
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/regexp';
import 'core-js/es6/map';
import 'core-js/es6/weak-map';
import 'core-js/es6/set';
import 'core-js/es6/array';
import 'core-js/es6/object';
import 'core-js/es7/array';
import 'core-js/es7/object';

不知道我还能做什么

标签: angularinternet-explorerinternet-explorer-11angular7polyfills

解决方案


您需要导入使 Angular 应用程序在 IE 中运行所需的所有 polyfill。除了您导入的上述 polyfills 外,还请在 polyfills.ts 中取消注释以下polyfills

import 'classlist.js';
import 'web-animations-js';
import 'core-js/es6/reflect';
import 'core-js/es7/reflect';
import 'zone.js/dist/zone';

然后你需要用 npm 安装一些包:

npm install --save classlist.js
npm install --save web-animations-js

还有一个博客你可以参考。


推荐阅读