0

I am running angular 9 on IE11. In 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
      }
}

Yes, it will work if I use "target": "es5" instead of "target": "es2015". So my question is can I use "target": "es2015" to run angular 9 on IE11? I am getting an error though. Error: err

I have commented all the core-js/.. imports from polyfills.ts. Because: https://stackoverflow.com/a/56893234/14208324 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 and Anglura-cli version:

Angular CLI: 9.1.12
Node: 10.15.3
OS: win32 x64

Angular: 9.1.12

Note: If I use "target": "es5" as target, no error is being shown but the page remains blank. App is working on chrome and firefox.

Am I missing something?

ChanChun
  • 23
  • 5
  • 1
    IE 11 supports basically nothing of ES6. – VLAZ Oct 19 '20 at 17:04
  • 2
    "*Can I use ES6 to run angular 9 on IE11? I am getting an error though.*" - you've already answered your question there. – Bergi Oct 19 '20 at 17:05
  • 1
    Does this answer your question? [Support for ES6 in Internet Explorer 11](https://stackoverflow.com/questions/39902809/support-for-es6-in-internet-explorer-11) – VLAZ Oct 19 '20 at 17:07
  • @ChanChun, The Angular app will not work with the IE browser if the target is set as es2015. If you think that the suggestion I provided below can be the answer to this question then I suggest you please mark the helpful suggestion as an accepted answer. It can help other community members in the future in similar kinds of issues. Thanks for your understanding. – Deepak-MSFT Oct 29 '20 at 03:18

1 Answers1

0

The Angular app will not work with the IE browser if the target is set as es2015.

I did not get any way to make the angular app work in the IE browser with the target set as es2015.

So there is no way to support the angular app by using the target as es2015.

User needs to set the target as es5 to support the IE browser.

Deepak-MSFT
  • 10,379
  • 1
  • 12
  • 19