Google Code Prettify

Angular 的瀏覽器支援現狀況

Angular supports most recent browsers. This includes the following specific versions:
BrowserSupported versions
Chromelatest
Firefoxlatest
Edge2 most recent major versions
IE11
10
9
IE Mobile11
Safari2 most recent major versions
iOS2 most recent major versions
AndroidNougat (7.0)
Marshmallow (6.0)
Lollipop (5.0, 5.1)
KitKat (4.4)
Angular's continuous integration process runs unit tests of the framework on all of these browsers for every pull request, using SauceLabs and Browserstack.

Polyfills

Angular is built on the latest standards of the web platform. Targeting such a wide range of browsers is challenging because they do not support all features of modern browsers.
You compensate by loading polyfill scripts ("polyfills") for the browsers that you must support. The table below identifies most of the polyfills you might need.
The suggested polyfills are the ones that run full Angular applications. You may need additional polyfills to support features not covered by this list. Note that polyfills cannot magically transform an old, slow browser into a modern, fast one.

Enabling polyfills

Angular CLI users enable polyfills through the src/polyfills.ts file that the CLI created with your project.
This file incorporates the mandatory and many of the optional polyfills as JavaScript import statements.
The npm packages for the mandatory polyfills (such as zone.js) were installed automatically for you when you created your project and their corresponding import statements are ready to go. You probably won't touch these.
But if you need an optional polyfill, you'll have to install its npm package. For example, if you need the web animations polyfill, you could install it with npm, using the following command (or the yarn equivalent):
# note that the web-animations-js polyfill is only here as an example
# it isn't a strict requirement of Angular anymore (more below)
npm install --save web-animations-js

Then open the polyfills.ts file and un-comment the corresponding import statement as in the following example:



src/polyfills.ts

/**
* Required to support Web Animations `@angular/platform-browser/animations`.
* Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation
**/
import 'web-animations-js';  // Run `npm install --save web-animations-js`.

If you can't find the polyfill you want in polyfills.ts, add it yourself, following the same pattern:
  1. install the npm package
  2. import the file in polyfills.ts
Non-CLI users should follow the instructions below.

Mandatory polyfills

These are the polyfills required to run an Angular application on each supported browser:
Browsers (Desktop & Mobile)Polyfills Required
Chrome, Firefox, Edge, Safari 9+
ES7/reflect (JIT only)
Safari 7 & 8, IE10 & 11, Android 4.1+
IE9

Optional browser features to polyfill

Some features of Angular may require additional polyfills.
For example, the animations library relies on the standard web animation API, which is only available in Chrome and Firefox today. (note that the dependency of web-animations-js in Angular is only necessary if AnimationBuilder is used.)
Here are the features which may require additional polyfills:
FeaturePolyfillBrowsers (Desktop & Mobile)
Required to reflect for metadata.
All current browsers. Enabled by default. Can remove if you always use AOT and only use Angular decorators.
Animations
Only if Animation Builder is used within the application--standard animation support in Angular doesn't require any polyfills (as of NG6).
If AnimationBuilder is used then the polyfill will enable scrubbing support for IE/Edge and Safari (Chrome and Firefox support this natively).
If you use the following deprecated i18n pipes:
All but Chrome, Firefox, Edge, IE11 and Safari 10
on SVG elements
IE10, IE11
when sending and receiving binary data
IE 9

Suggested polyfills

Below are the polyfills which are used to test the framework itself. They are a good starting point for an application.
PolyfillLicenseSize*
MIT0.5KB
MIT27.4KB
Public domain1KB
MIT / Unicode license13.5KB
Apache14.8KB
MIT4KB
MIT1.3KB
MIT0.4KB
* Figures are for minified and gzipped code, computed with the closure compiler.

Polyfills for non-CLI users

If you are not using the CLI, you should add your polyfill scripts directly to the host web page (index.html), perhaps like this.



src/index.html

  1. <!-- pre-zone polyfills -->
  2. <script src="node_modules/core-js/client/shim.min.js"></script>
  3. <script src="node_modules/web-animations-js/web-animations.min.js"></script>
  4. <script>
  5. /**
  6. * you can configure some zone flags which can disable zone interception for some
  7. * asynchronous activities to improve startup performance - use these options only
  8. * if you know what you are doing as it could result in hard to trace down bugs..
  9. */
  10. // __Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
  11. // __Zone_disable_on_property = true; // disable patch onProperty such as onclick
  12. // __zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
  13.  
  14. /*
  15. * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
  16. * with the following flag, it will bypass `zone.js` patch for IE/Edge
  17. */
  18. // __Zone_enable_cross_context_check = true;
  19. </script>
  20. <!-- zone.js required by Angular -->
  21. <script src="node_modules/zone.js/dist/zone.js"></script>
  22.  
  23. <!-- application polyfills -->

Refence:
https://stackoverflow.com/questions/43136792/angular-4-0-0-app-built-by-angular-cli-1-0-0-not-working-in-ie11


From:
https://angular.io/guide/browser-support