Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.9k views
in Technique[技术] by (71.8m points)

typescript - Angular 6 project not loading in IE11

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) 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) 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';

Any ideas on what I may be missing since this is an Angular 6 project?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Did you verify that any subscribe function that is running outside of your ts files are using

.subscribe(function(data) { });

instead of

.subscribe((data) => {});

IE is not able to execute this style of anonymous function properly.

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/)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...