我的angular 6项目在chrome中加载,但不能在IE11中加载。我使用了以下问题:Angular 2 / 4 / 5 not working in IE11试图解决这个问题,但建议的解决方案都没有帮助。下面是我在polyfills中拥有的导入列表。
1)我取消了polyfills.ts中所有导入的注释,并运行了适当的npm install命令。2)我在index.html中添加了以下行
<meta http-equiv="X-UA-Compatible" content="IE=edge" />3)并且我还按照文章中的建议在IE11中关闭了“在兼容性视图中显示intranet站点”
但是以下的解决方案都没有起到作用。
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/weak-map';
import 'core-js/es6/set';
import 'classlist.js';
import 'core-js/es6/reflect';
import 'core-js/es7/reflect';
import 'web-animations-js';
import 'zone.js/dist/zone';由于这是一个Angular 6项目,我可能会遗漏什么?
发布于 2018-10-17 22:18:38
您是否验证了在ts文件之外运行的任何订阅函数正在使用
.subscribe(function(data) { });而不是
.subscribe((data) => {});IE无法正确执行此样式的匿名函数。
还要确保在没有填充程序(https://kangax.github.io/compat-table/es6/)的情况下,您没有在angular应用程序之外使用任何ES6组件
发布于 2018-09-25 17:09:44
更新angular-cli,webpack可能会有所帮助。
我已经解决了IE 10中的一个问题。参考:TypeError: Unable to get property 'ngMetadataName' of undefined or null reference on IE 10
发布于 2019-02-21 19:53:22
我按照建议注释掉了代码,直到我的应用程序在IE11中启动。
我的菜单组件中有一个图像路径导致了这个问题。已对路径进行排序,然后应用程序启动。
https://stackoverflow.com/questions/52211227
复制相似问题