使用Angular 5的IE 11兼容性错误 [英] IE 11 compatibility errors using Angular 5

查看:145
本文介绍了使用Angular 5的IE 11兼容性错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经构建了Angular应用程序,然后在服务器中运行它.

I have build my Angular application then run it in server.

我遇到了本地主机未显示的错误.

I got errors that where not shown in localhost.

Unable to get property 'onHover' of undefined or null reference.

文件 Chart.min.js,ligne:10,colone:115187

Error SCRIPT 1028 Expected identifier, string or number

文件 polyfills.bundle.js,ligne:6399,Colonne:5 .

Object doesn't support property or method 'querySelector

文件 styles.bundle.js,ligne:215,colone:2

Expected identifier

文件: vendor.bundle.js,ligne:3169,Colonne:23

我在polyfills.ts中没有注释注释

I have uncommente imports in 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';

//import 'classlist.js';  // Run `npm install --save classlist.js`.
import 'core-js/es7/reflect';

// import 'web-animations-js';  // Run `npm install --save web-animations-js`.
import 'zone.js/dist/zone';  // Included with Angular CLI.

加载应用程序时,这里的网络流量

Here's network trafic when loading app

推荐答案

在index.html中添加元标记.这也是必要的一行.

Add meta tag in the index.html. This is also a necessary line.

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

这篇关于使用Angular 5的IE 11兼容性错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆