浏览器支持

Angular supports most recent browsers. This includes the following specific versions:

Angular 支持大多数常用浏览器,包括下列版本:

ChromeFirefoxEdgeIESafariiOSAndroidIE mobile

latest

最新版

latest

最新版

14111010Marshmallow (6.0)11
131099Lollipop
(5.0, 5.1)
988KitKat
(4.4)
77Jelly Bean
(4.1, 4.2, 4.3)

Angular's continuous integration process runs unit tests of the framework on all of these browsers for every pull request, using SauceLabs and Browserstack.

Angular 在持续集成过程中,对每一个提交都会使用 SauceLabsBrowserstack 在上述所有浏览器上执行单元测试。

Polyfills

填充库 (polyfill)

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.

Angular 构建于 Web 平台的最新标准之上。 要支持这么多浏览器是一个不小的挑战,因为它们不支持现代浏览器的所有特性。

You can compensate by loading polyfill scripts ("polyfills") on the host web page (index.html) that implement missing features in JavaScript.

你可以通过在宿主页面 (index.html) 中加载填充脚本 (“polyfills”) 来加以弥补,这些脚本实现了浏览器缺失的 JavaScript 特性。

<script src="node_modules/core-js/client/shim.min.js"></script>

A particular browser may require at least one polyfill to run any Angular application. You may need additional polyfills for specific features.

要运行 Angular 应用,某些浏览器可能需要至少一个填充库。除此之外,如果要支持某些特定的特性,你可能还需要另一些填充库。

The tables below can help you determine which polyfills to load, depending on the browsers you target and the features you use.

下表将帮你决定加载哪些填充库,具体取决于目标浏览器和要用到的特性。

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.

这些建议的填充库是运行完整 Angular 应用所需的。 你可能还会需要另一些的填充库来支持没有出现在此列表中的哪些特性。 注意,这些填充库并没有神奇的魔力来把老旧、慢速的浏览器变成现代、快速的浏览器,它只是填充了 API。

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+None
Safari 7 & 8, IE10 & 11, Android 4.1+

ES6

IE9

ES6
classList

Optional browser features to polyfill

可选浏览器特性的填充库

Some features of Angular may require additional polyfills.

有些 Angular 特性可能需要额外的填充库。

For example, the animations library relies on the standard web animation API, which is only available in Chrome and Firefox today. You'll need a polyfill to use animations in other browsers.

例如,动画库依赖于标准的 web 动画 API,目前它只在 Chrome 和 Firefox 上可用。你可能需要一个填充库来在其它浏览器上使用动画功能。

Here are the features which may require additional polyfills:

下列特性可能需要更多填充库:

Feature

特性

Polyfill

填充库

Browsers (desktop & mobile)

浏览器(桌面和移动)

Animations

动画

Web Animations

Web 动画

All but Chrome and Firefox
Not supported in IE9

除 Chrome 和 Firefox 外的所有,但不支持 IE9

Date, currency, decimal and percent pipes

Datecurrencydecimal 和 percent 管道

Intl API

All but Chrome, Firefox, Edge, IE11 and Safari 10

除了 Chrome、Firefox、Edge、IE11 和 Safari 10 外的所有浏览器

NgClasson SVG elements

在 SVG 元素上用 NgClass

classList

IE10, IE11

Http when sending and receiving binary data

用 Http 发送和接受二进制数据

Typed Array
Blob
FormData

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.

下表中是用来测试框架本身的填充库,它们是应用程序的优质起点。

Polyfill

填充库

Licence

授权方式

Size*

大小*

ES6MIT27.4KB
classList

Public domain

公共域

1KB
IntlMIT / Unicode license13.5KB
Web AnimationsApache14.8KB
Typed ArrayMIT4KB
BlobMIT1.3KB
FormDataMIT0.4KB

* Figures are for minified and gzipped code, computed with the closure compiler.

* 这些指标测量的是最小化 (minify) 并且 gzip 过的代码,使用 closure compiler 计算出的结果。