Angular 7项目在Internet Explorer 11中无法正常工作 [英] Angular 7 project is not working in Internet Explorer 11
问题描述
我已经完成了互联网上不同帖子中提到的所有内容,但是我的问题仍然存在.
I have done all whatever mentioned in different posts over internet but my issue still persists.
我未评论IE 9、10、11所需的polyfills
/** 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';
我在index.html中应用了元标记
<meta http-equiv="X-UA-Compatible" content="IE=edge" >
但是在IE 11中工作时仍然出现错误:
-
SCRIPT438:对象不支持属性或方法绑定" runtime.js(208,11)
SCRIPT438: Object doesn't support property or method 'bind' runtime.js (208,11)
SCRIPT1010:预期的标识符polyfills.js(3846,36)
SCRIPT1010: Expected identifier polyfills.js (3846,36)
SCRIPT1010:预期的标识符styles.js(310,24)
SCRIPT1010: Expected identifier styles.js (310,24)
SCRIPT1028:期望的标识符,字符串或数字vendor.js(298,5)
SCRIPT1028: Expected identifier, string or number vendor.js (298,5)
SCRIPT1010:预期的标识符main.js(1424,32)
SCRIPT1010: Expected identifier main.js (1424,32)
编辑1 这是我的tsconfig.json:
EDIT 1 Here is my tsconfig.json:
{
"compileOnSave": false,
"compilerOptions": {
"outDir": "./dist/out-tsc",
"baseUrl": "src",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es5",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2016",
"dom"
],
"paths": {
"jszip": [
"../node_modules/jszip/dist/jszip.min.js"
]
}
}
}
我该怎么办?
任何帮助将不胜感激.
推荐答案
我通过以下4个步骤解决了这个问题! 为您服务,请从第3步开始.
I solve this problem with below 4 steps ! for you, start from step3.
-
在您的项目中找到polyfill.ts
Find polyfill.ts in your project
取消注释所有评论的导入-保存
Uncommented all commented import - save
在npm以下安装
- npm install-保存classlist.js
- npm install-保存web-animations-js
ng服务
信用: https://blog.angularindepth.com/angular-and -internet-explorer-5e59bb6fb4e9
++如果您使用的是angular8 请参阅 : https://stackoverflow.com/a/59317315/10109195
++If you are using angular8 please refer to : https://stackoverflow.com/a/59317315/10109195
这篇关于Angular 7项目在Internet Explorer 11中无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!