【发布时间】:2019-11-06 20:59:09
【问题描述】:
我是Angular 8 的新手,目前正在其中开发web-app。它在Google Chrome 和EDGE 中运行良好,但它甚至没有在IE 11 中加载。我通过互联网探索了解决方案并尝试了一些建议的解决方案。
我尝试的是:
尝试 01:
将这行代码粘贴到index.html
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<script src="https://npmcdn.com/angular2/es6/dev/src/testing/shims_for_IE.js"></script>
尝试 02
在polyfills.ts中添加了这些行
/** IE9, IE10 and IE11 requires all of the following polyfills. **/
import 'core-js/es/symbol';
import 'core-js/es/object';
import 'core-js/es/function';
import 'core-js/es/parse-int';
import 'core-js/es/parse-float';
import 'core-js/es/number';
import 'core-js/es/math';
import 'core-js/es/string';
import 'core-js/es/date';
import 'core-js/es/array';
import 'core-js/es/regexp';
import 'core-js/es/map';
import 'core-js/es/set';
尝试 03
在browserlist 文件中包含对IE 9-11 的支持。
但一切都是徒劳的,我无法解决这个问题。 谁能指出我做错了什么!
【问题讨论】:
-
清除ie浏览器缓存并重试
-
我已经尝试过了。即使我停止了缓存,但它没有奏效。
-
您是否尝试过将
tsconfig.json中的目标从es2015更改为es5?关于 SO 处理该问题有几个答案,例如:stackoverflow.com/questions/56563742/… 或 -
在尝试 1 中,您是否尝试将 content="IE=edge" 更改为 content="IE=11"?
-
@Arikael 我在某处读到,如果您在
angular 8工作,这不是一个好的解决方案。
标签: javascript angular typescript internet-explorer-11 angular8