Angular 6项目未在IE11中加载 [英] Angular 6 project not loading in IE11
问题描述
我的angular 6项目在chrome中加载,但在IE11中不加载.我使用了以下问题: Angular 2/4/5无法在IE11中工作来尝试解决该问题,但是建议的解决方案都没有帮助.这是我在polyfill中输入的清单.
My angular 6 project loads in chrome but it does not load in IE11. I used the following question: Angular 2 / 4 / 5 not working in IE11 to try and solve the issue but none of the suggested solutions helped. Here is a list of the imports I have in polyfills.
1)我取消了对polyfills.ts中所有导入的注释,并运行了相应的npm install命令. 2)我在index.html中添加了以下行
1) I uncommented all of the imports in my polyfills.ts and ran the appropriate npm install commands. 2) I added the following line in my index.html
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
3)而且我还按照帖子
3) And I also turned off the "Display intranet sites in Compatibility View" in IE11 as suggested in the post
但以下解决方案均无济于事.
but none of the following solutions helped.
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项目,我可能会缺少的任何想法吗?
Any ideas on what I may be missing since this is an Angular 6 project?
推荐答案
您是否验证了ts文件外部运行的所有订阅功能都在使用
Did you verify that any subscribe function that is running outside of your ts files are using
.subscribe(function(data) { });
代替
.subscribe((data) => {});
IE无法正确执行这种样式的匿名函数.
IE is not able to execute this style of anonymous function properly.
还请确保在没有垫片的情况下不要在角度应用程序之外使用任何ES6组件( https://kangax.github.io/compat-table/es6/)
Also make sure you are not using any ES6 components outside of your angular app without having a shim to handle them (https://kangax.github.io/compat-table/es6/)
这篇关于Angular 6项目未在IE11中加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!