Home  >  Article  >  Web Front-end  >  A brief discussion on how angular8 is compatible with ie10+ version

A brief discussion on how angular8 is compatible with ie10+ version

青灯夜游
青灯夜游forward
2021-03-15 10:41:412660browse

This article will introduce to you how angular8 is compatible with ie10 and above (if win10 is compatible with its own browser). It has certain reference value. Friends in need can refer to it. I hope it will be helpful to everyone.

A brief discussion on how angular8 is compatible with ie10+ version

Related recommendations: "angular tutorial"

1.pollyfills.ts add the following two lines

import 'classlist.js'; // npm install --save classlist.js
import 'web-animations-js'; // npm install --save web-animations-js

2.tsconfig.json target changed to es2015

By default, it will Ignore older browsers (like IE 9-11) with their compilation target set to ES2015. As a result, two release packages are generated with differential loading enabled. If you ignore all browsers that don't support ES2015, only one version will be generated. To understand the build results of differential loading under different configurations, please refer to the table below.

3.browserslist, if there is no browserslist in the project, create a new one, select text mode, and add the following code:

> 0.5%
last 2 versions
Firefox ESR
not dead
not IE 9-10 # For IE 9-10 support, remove 'not'.
IE 11

4. Create a new file tsconfig.app.es5.json in the root directory, change the target to es5, and inherit tsconfig.app.json

{
  "extends": "./tsconfig.app.json",
  "compilerOptions": {
    "target": "es5"
  }
}

5. Configure angular.json, new Add the following two lines

6. Run ng serve -c=es5

and finally access it in ie10 and ie11 Your project address, you can see the interface! ! ! !

For more programming related knowledge, please visit: Programming Video! !

The above is the detailed content of A brief discussion on how angular8 is compatible with ie10+ version. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete