angular - Angular 7 项目在 Internet Explorer 11 中不起作用
问题描述
我已经完成了互联网上不同帖子中提到的所有事情,但我的问题仍然存在。
我取消注释 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:对象不支持属性或方法“绑定”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
推荐阅读
- git - Composer 使用标签或自定义分支从自定义 Git 存储库中提取包
- javascript - 在 jQuery 块内时函数不起作用
- javascript - 如何在不使用道具作为初始状态的情况下对 Gatsby 中的一组项目进行洗牌?
- repast-simphony - repastpy 是如何设置和启动的?
- c# - Xamarin Forms 中条目的水平放置是否存在任何已知问题?
- c# - 我的 DevComponents.Dotnetbars.Controls 上有一个错误,它们没有放在表单上
- spring - 如何在 Spring Webflux 中使用 @RequestBody 并避免 IllegalStateException?
- html - 如何在 css(HTML) 中定义换行符
- javascript - 基本函数与匿名函数
- c# - 如何模拟表达式
>> 使用喜欢 It.Is >>