angular - 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';
不知道我还能做什么
解决方案
您需要导入使 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
还有一个博客你可以参考。
推荐阅读
- android - 优雅的数字按钮库不同步
- windows - 如何在小斗士2(LF2)中解析dat文件
- ios - UITabBarController 内的 UICollectionView
- c# - C# 简单的正则表达式名称组捕获
- python - 使用 Keras 进行二元分类时,测试损失不会改善
- android - android:动态创建视图并稍后访问它们
- c# - 在更改日志之前获取实体
- python - 从字符串中提取字符并在 Python 中形成新列
- python - 如何使用 numpy 将多个数据分别保存在单个输出文件中
- ruby-on-rails - 如果从辅助方法 rails 更改,则不会显示 I18n 转换的值