我已经完成了互联网上不同帖子中提到的所有操作,但我的问题仍然存在。
我取消了对 IE 9、10、11 所需的 polyfill 的注释
/** 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:对象不支持属性或方法“绑定(bind)” runtime.js(208,11)
SCRIPT1010:预期标识符 polyfills.js (3846,36)
SCRIPT1010:预期标识符 styles.js (310,24)
SCRIPT1028:预期标识符、字符串或数字 vendor.js (298,5)
SCRIPT1010:预期标识符 main.js (1424,32)
编辑 1 这是我的 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 步开始。
在你的项目中找到 polyfill.ts
取消注释所有已注释的导入 - 保存
在 npm 下安装
- npm install --save classlist.js
- npm install --save web-animations-js
服务
信用:https://blog.angularindepth.com/angular-and-internet-explorer-5e59bb6fb4e9
++如果你使用的是angular8 请参阅 : https://stackoverflow.com/a/59317315/10109195
关于Angular 7 项目在 Internet Explorer 11 中不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55647043/