IE11支持es2015吗?
Does IE11 support es2015?
我在 IE11 上 运行ning angular 9。在tsconfig.json
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es2015",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2017",
"dom"
]
},
"angularCompilerOptions": {
"strictInjectionParameters": true
}
}
是的,如果我使用 "target": "es5"
而不是 "target": "es2015"
,它会起作用。
所以我的问题是我可以在 IE11 上使用 "target": "es2015"
到 运行 angular 9 吗?我收到一个错误。
错误:err
我评论了所有从 polyfills.ts
导入的 core-js/..
。
因为:
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';
/** IE10 and IE11 requires the following for the Reflect API. */
// import 'core-js/es6/reflect';
/** Evergreen browsers require these. **/
// Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove.
// import 'core-js/es7/reflect';
/**
* Web Animations `@angular/platform-browser/animations`
* Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
* Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
**/
import 'web-animations-js'; // Run `npm install --save web-animations-js`.
/***************************************************************************************************
* Zone JS is required by default for Angular itself.
*/
import 'zone.js/dist/zone'; // Included with Angular CLI.
Angular 和 Anglura-cli 版本:
Angular CLI: 9.1.12
Node: 10.15.3
OS: win32 x64
Angular: 9.1.12
注意:如果我使用 "target": "es5"
作为目标,则不会显示任何错误,但页面仍为空白。应用正在 chrome 和 firefox 上运行。
我是不是漏掉了什么?
如果 target 设置为 es2015.[=10,Angular 应用将无法与 IE 浏览器一起使用=]
我没有任何办法让 angular 应用程序在 IE 浏览器中工作,target 设置为 es2015.
因此无法通过使用 target 作为 es2015.[=10= 来支持 angular 应用程序]
用户需要将目标设置为es5以支持IE浏览器。
我在 IE11 上 运行ning angular 9。在tsconfig.json
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es2015",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2017",
"dom"
]
},
"angularCompilerOptions": {
"strictInjectionParameters": true
}
}
是的,如果我使用 "target": "es5"
而不是 "target": "es2015"
,它会起作用。
所以我的问题是我可以在 IE11 上使用 "target": "es2015"
到 运行 angular 9 吗?我收到一个错误。
错误:err
我评论了所有从 polyfills.ts
导入的 core-js/..
。
因为:
/** 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';
/** IE10 and IE11 requires the following for the Reflect API. */
// import 'core-js/es6/reflect';
/** Evergreen browsers require these. **/
// Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove.
// import 'core-js/es7/reflect';
/**
* Web Animations `@angular/platform-browser/animations`
* Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
* Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
**/
import 'web-animations-js'; // Run `npm install --save web-animations-js`.
/***************************************************************************************************
* Zone JS is required by default for Angular itself.
*/
import 'zone.js/dist/zone'; // Included with Angular CLI.
Angular 和 Anglura-cli 版本:
Angular CLI: 9.1.12
Node: 10.15.3
OS: win32 x64
Angular: 9.1.12
注意:如果我使用 "target": "es5"
作为目标,则不会显示任何错误,但页面仍为空白。应用正在 chrome 和 firefox 上运行。
我是不是漏掉了什么?
如果 target 设置为 es2015.[=10,Angular 应用将无法与 IE 浏览器一起使用=]
我没有任何办法让 angular 应用程序在 IE 浏览器中工作,target 设置为 es2015.
因此无法通过使用 target 作为 es2015.[=10= 来支持 angular 应用程序]
用户需要将目标设置为es5以支持IE浏览器。