Microsoft Edge上的Angular应用未加载CSS

时间:2019-10-19 01:05:54

标签: css angular internet-explorer microsoft-edge

我的Angular应用程序可在每种浏览器上完美运行,但在Edge和IE上却无法加载CSS。很难解释,因为它加载了,但是不起作用,我不知道为什么。

如您所见:

Image

CSS就在眼前,但应用程序就像根本没有CSS。

我添加了所需的所有polyfill和该元标记:

<meta http-equiv="X-UA-Compatible" content="IE=edge" />

我在Google上搜索了很多,但是所有解决方案都是关于应用程序根本无法运行,我的应用程序可以正常运行,只是没有CSS。

这是我的Polyfills.ts

import 'zone.js/dist/zone';  // Included with Angular CLI.
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';

1 个答案:

答案 0 :(得分:-1)

检查位于项目根目录的browserlist文件。默认情况下,通常不支持IE11。

您将发现必须更改的这一行

not IE 9-11 # For IE 9-11 support, remove 'not'.