无法在IE浏览器中打开Angular应用程序,而在Chrome中打开应用程序

时间:2019-03-25 06:05:57

标签: javascript angular

我是使用Angular 7版本实现的应用程序,它在chrome浏览器和Edge浏览器中打开,但未在IE浏览器中打开。 有人可以帮我吗?

2 个答案:

答案 0 :(得分:0)

您是否在polyfills.ts中添加了以下内容?

/** IE9, IE10 and IE11 requires all of the following polyfills. **/
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';

/** IE10 and IE11 requires the following for NgClass support on SVG elements */
import 'classlist.js';  // Run `npm install --save classlist.js`.

/** IE10 and IE11 requires the following for the Reflect API. */
import 'core-js/es6/reflect';

此外,对于较旧的浏览器(例如IE),您应该在其documentation上检查所需的polyfill,因为您可能正在使用该列表中的某些功能,但是您可能会错过一些不包含在polyfills的默认设置中。

答案 1 :(得分:0)

Angular支持所有IE版本(11、10、9)。但是要使其成为可能,您需要添加Polyfills。需要polyfill才能在每个受支持的浏览器上运行Angular应用程序。

因此,如果您的项目在Scope中有IE 9,10,11版本,则需要将以下代码添加到polyfills.ts中,该代码可在有角项目的src文件夹中找到

P1
# inverted.pbm
10 10
1 0 0 0 0 0 0 0 0 1
0 1 0 0 0 0 0 0 1 0
0 0 1 0 0 0 0 1 0 0
0 0 0 1 0 0 1 0 0 0
0 0 0 0 1 1 0 0 0 0
0 0 0 0 1 1 0 0 0 0
0 0 0 1 0 0 1 0 0 0
0 0 1 0 0 0 0 1 0 0
0 1 0 0 0 0 0 0 1 0
1 0 0 0 0 0 0 0 0 1
\FF
相关问题