要解决Angular CLI 11版本在Internet Explorer 11中无法正常工作的问题,可以尝试以下解决方法:
/***************************************************************************************************
* BROWSER POLYFILLS
*/
/** IE10 and IE11 requires the following for NgClass support on SVG elements */
// import 'classlist.js'; // Run `npm install --save 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.
/***************************************************************************************************
* APPLICATION IMPORTS
*/
npm install classlist.js --save
npm install web-animations-js --save
/** 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';
npm install core-js --save
这些步骤应该能够解决Angular CLI 11版本在Internet Explorer 11中无法正常工作的问题。请尝试以上解决方法,并确保按照正确的顺序执行它们。
上一篇:Angular CLI 10 ng build --prod 发出空行。
下一篇:Angular CLI 17.0.10版本中,“ng new”命令在src根文件夹中不会生成app.module.ts文件。