angular-cn/public/docs/ts/latest/guide/browser-support.jade

288 lines
8.7 KiB
Plaintext
Raw Normal View History

2016-09-09 22:21:40 -04:00
block includes
include ../_util-fns
:marked
Angular supports most recent browsers. This includes the following specific versions:
2016-12-05 07:12:49 -05:00
Angular 支持大多数常用浏览器,包括下列版本:
2016-11-22 07:07:16 -05:00
table
tr
th Chrome
th Firefox
th Edge
th IE
th Safari
th iOS
th Android
th IE mobile
tr
2016-11-22 07:07:16 -05:00
td
p latest
p 最新版
td
p latest
p 最新版
td 14
td 11
td 10
td 10
td Marshmallow (6.0)
td 11
tr
td
td
td 13
td 10
td 9
td 9
td Lollipop<br>(5.0, 5.1)
td
tr
td
td
td
td 9
td 8
td 8
td KitKat<br>(4.4)
td
tr
td
td
td
td
td 7
td 7
td Jelly Bean<br>(4.1, 4.2, 4.3)
td
2016-11-22 07:07:16 -05:00
2016-09-09 22:21:40 -04:00
.l-sub-section
:marked
Angular's continuous integration process runs unit tests of the framework on all of these browsers for every pull request,
using <a href="https://saucelabs.com/" target="_blank">SauceLabs</a> and
<a href="https://www.browserstack.com" target="_blank">Browserstack</a>.
2016-11-22 07:07:16 -05:00
2016-12-05 07:12:49 -05:00
Angular 在持续集成过程中,对每一个提交都会使用 <a href="https://saucelabs.com/" target="_blank">SauceLabs</a> 和
<a href="https://www.browserstack.com" target="_blank">Browserstack</a> 在上述所有浏览器上执行单元测试。
2016-09-09 22:21:40 -04:00
:marked
2016-11-22 07:07:16 -05:00
## Polyfills #
2016-12-05 07:12:49 -05:00
## 填充库 (polyfill) #
Angular is built on the latest standards of the web platform.
2016-09-09 22:21:40 -04:00
Targeting such a wide range of browsers is challenging because they do not support all features of modern browsers.
2016-11-22 07:07:16 -05:00
2016-12-05 07:12:49 -05:00
Angular 构建于 Web 平台的最新标准之上。
2016-09-19 10:23:00 -04:00
要支持这么多浏览器是一个不小的挑战,因为它们不支持现代浏览器的所有特性。
2016-11-22 07:07:16 -05:00
You can compensate by loading polyfill scripts ("polyfills") on the host web page (`index.html`)
2016-09-09 22:21:40 -04:00
that implement missing features in JavaScript.
2016-11-22 07:07:16 -05:00
2016-12-05 07:12:49 -05:00
你可以通过在宿主页面 (`index.html`) 中加载填充脚本 (“polyfills”) 来加以弥补,这些脚本实现了浏览器缺失的 JavaScript 特性。
2016-11-22 07:07:16 -05:00
+makeExample('quickstart/ts/src/index.html', 'polyfills')(format='.')
2016-09-09 22:21:40 -04:00
:marked
A particular browser may require at least one polyfill to run _any_ Angular application.
You may need additional polyfills for specific features.
2016-11-22 07:07:16 -05:00
2016-12-05 07:12:49 -05:00
要运行 Angular 应用,某些浏览器可能需要至少一个填充库。除此之外,如果要支持某些特定的特性,你可能还需要另一些填充库。
The tables below can help you determine which polyfills to load, depending on the browsers you target and the features you use.
2016-11-22 07:07:16 -05:00
2016-12-05 07:12:49 -05:00
下表将帮你决定加载哪些填充库,具体取决于目标浏览器和要用到的特性。
2016-09-09 22:21:40 -04:00
.alert.is-important
:marked
The suggested polyfills are the ones that run full Angular applications.
2016-09-09 22:21:40 -04:00
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.
2016-11-22 07:07:16 -05:00
2016-12-05 07:12:49 -05:00
这些建议的填充库是运行完整 Angular 应用所需的。
2016-09-14 01:12:05 -04:00
你可能还会需要另一些的填充库来支持没有出现在此列表中的哪些特性。
2016-12-05 07:12:49 -05:00
注意,这些填充库并没有神奇的魔力来把老旧、慢速的浏览器变成现代、快速的浏览器,它只是填充了 API。
2016-11-22 07:07:16 -05:00
:marked
2016-11-22 07:07:16 -05:00
### Mandatory polyfills ##
### 强制性填充库 ##
2016-09-09 22:21:40 -04:00
These are the polyfills required to run an Angular application on each supported browser:
2016-11-22 07:07:16 -05:00
2016-09-14 01:12:05 -04:00
下表是填充库对每个支持的浏览器都是需要的:
2016-11-22 07:07:16 -05:00
table
2016-09-09 22:21:40 -04:00
tr(style="vertical-align: top")
2016-11-22 07:07:16 -05:00
th
2016-09-14 01:12:05 -04:00
p Browsers (desktop & mobile)
2016-11-22 07:07:16 -05:00
p 浏览器(桌面和移动)
th
2016-09-14 01:12:05 -04:00
p Polyfills required
p 需要的填充库
2016-09-09 22:21:40 -04:00
tr(style="vertical-align: top")
td Chrome, Firefox, Edge, Safari 9+
td None
2016-09-09 22:21:40 -04:00
tr(style="vertical-align: top")
td Safari 7 & 8, IE10 & 11, Android 4.1+
2016-09-09 22:21:40 -04:00
td
:marked
[ES6](#core-es6)
tr(style="vertical-align: top")
td IE9
2016-09-09 22:21:40 -04:00
td
:marked
[ES6<br>classList](#classlist)
:marked
2016-11-22 07:07:16 -05:00
### Optional browser features to polyfill ##
### 可选浏览器特性的填充库 ##
2016-09-09 22:21:40 -04:00
Some features of Angular may require additional polyfills.
2016-11-22 07:07:16 -05:00
2016-12-05 07:12:49 -05:00
有些 Angular 特性可能需要额外的填充库。
2016-11-22 07:07:16 -05:00
2016-09-09 22:21:40 -04:00
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.
2016-11-22 07:07:16 -05:00
2016-12-05 07:12:49 -05:00
例如,动画库依赖于标准的 web 动画 API目前它只在 Chrome 和 Firefox 上可用。你可能需要一个填充库来在其它浏览器上使用动画功能。
2016-11-22 07:07:16 -05:00
Here are the features which may require additional polyfills:
2016-10-06 07:38:14 -04:00
下列特性可能需要更多填充库:
2016-11-22 07:07:16 -05:00
table
2016-09-09 22:21:40 -04:00
tr(style="vertical-align: top")
2016-11-22 07:07:16 -05:00
th
2016-09-14 01:12:05 -04:00
p Feature
p 特性
2016-11-22 07:07:16 -05:00
th
2016-09-14 01:12:05 -04:00
p Polyfill
p 填充库
2016-11-22 07:07:16 -05:00
th(style="width: 50%")
2016-09-14 01:12:05 -04:00
p Browsers (desktop & mobile)
2016-11-22 07:07:16 -05:00
p 浏览器(桌面和移动)
2016-09-09 22:21:40 -04:00
tr(style="vertical-align: top")
td
2016-12-05 07:12:49 -05:00
p
a(href="./animations.html") Animations
p
a(href="./animations.html") 动画
2016-09-09 22:21:40 -04:00
td
:marked
[Web Animations](#web-animations)
2016-11-22 07:07:16 -05:00
2016-12-05 07:12:49 -05:00
[Web 动画](#web-animations)
2016-11-22 07:07:16 -05:00
td
2016-09-14 01:12:05 -04:00
p All but Chrome and Firefox<br>Not supported in IE9
2016-12-05 07:12:49 -05:00
p 除 Chrome 和 Firefox 外的所有,但不支持 IE9
2016-09-09 22:21:40 -04:00
tr(style="vertical-align: top")
td
2016-12-05 07:12:49 -05:00
p
a(href="../api/common/index/DatePipe-pipe.html" target="_blank") Date
span ,
a(href="../api/common/index/CurrencyPipe-pipe.html" target="_blank") currency
span ,
a(href="../api/common/index/DecimalPipe-pipe.html" target="_blank") decimal
span and
a(href="../api/common/index/PercentPipe-pipe.html" target="_blank") percent
span pipes
p
a(href="../api/common/index/DatePipe-pipe.html" target="_blank") Date
span 、
a(href="../api/common/index/CurrencyPipe-pipe.html" target="_blank") currency
span 、
a(href="../api/common/index/DecimalPipe-pipe.html" target="_blank") decimal
span &nbsp;和&nbsp;
a(href="../api/common/index/PercentPipe-pipe.html" target="_blank") percent
span &nbsp;管道
2016-09-09 22:21:40 -04:00
td
:marked
[Intl API](#intl)
2016-11-22 07:07:16 -05:00
td
p All but Chrome, Firefox, Edge, IE11 and Safari 10
2016-12-05 07:12:49 -05:00
p 除了 Chrome、Firefox、Edge、IE11 和 Safari 10 外的所有浏览器
2016-09-09 22:21:40 -04:00
tr(style="vertical-align: top")
2016-11-22 07:07:16 -05:00
td
2016-12-05 07:12:49 -05:00
p
a(href="../api/common/index/NgClass-directive.html" target="_blank") NgClass
span on SVG elements
p
span 在 SVG 元素上用&nbsp;
2016-09-14 01:12:05 -04:00
a(href="../api/common/index/NgClass-directive.html" target="_blank") NgClass
2016-09-09 22:21:40 -04:00
td
:marked
[classList](#classlist)
td IE10, IE11
2016-09-09 22:21:40 -04:00
tr(style="vertical-align: top")
td
2016-12-05 07:12:49 -05:00
p
2016-09-14 01:12:05 -04:00
a(href="./server-communication.html") Http
span when sending and receiving binary data
2016-12-05 07:12:49 -05:00
p
span 用&nbsp;
2016-09-14 01:12:05 -04:00
a(href="./server-communication.html") Http
2016-12-05 07:12:49 -05:00
span &nbsp;发送和接受二进制数据
2016-09-09 22:21:40 -04:00
td
:marked
[Typed&nbsp;Array](#typedarray) <br>[Blob](#blob)<br>[FormData](#formdata)
td IE 9
:marked
2016-11-22 07:07:16 -05:00
### Suggested polyfills ##
### 建议的填充库 ##
Below are the polyfills which are used to test the framework itself. They are a good starting point for an application.
2016-09-14 01:12:05 -04:00
下表中是用来测试框架本身的填充库,它们是应用程序的优质起点。
2016-11-22 07:07:16 -05:00
table
tr
2016-11-22 07:07:16 -05:00
th
2016-09-14 01:12:05 -04:00
p Polyfill
p 填充库
2016-11-22 07:07:16 -05:00
th
2016-09-14 01:12:05 -04:00
p Licence
p 授权方式
2016-11-22 07:07:16 -05:00
th
2016-09-14 01:12:05 -04:00
p Size*
p 大小*
tr
2016-09-09 22:21:40 -04:00
td
a#core-es6(href="https://github.com/zloirock/core-js" target="_blank") ES6
td MIT
td 27.4KB
tr
td
2016-09-09 22:21:40 -04:00
a#classlist(href="https://github.com/eligrey/classList.js" target="_blank") classList
2016-11-22 07:07:16 -05:00
td
2016-09-14 01:12:05 -04:00
p Public domain
p 公共域
td 1KB
tr
td
2016-09-09 22:21:40 -04:00
a#intl(href="https://github.com/andyearnshaw/Intl.js" target="_blank") Intl
td MIT / Unicode license
td 13.5KB
tr
td
a#web-animations(href="https://github.com/web-animations/web-animations-js" target="_blank") Web Animations
td Apache
td 14.8KB
tr
td
a#typedarray(href="https://github.com/inexorabletash/polyfill/blob/master/typedarray.js" target="_blank") Typed Array
td MIT
td 4KB
tr
2016-09-09 22:21:40 -04:00
td
a#blob(href="https://github.com/eligrey/Blob.js" target="_blank") Blob
td MIT
td 1.3KB
tr
2016-09-09 22:21:40 -04:00
td
a#formdata(href="https://github.com/francois2metz/html5-formdata" target="_blank") FormData
td MIT
td 0.4KB
:marked
\* Figures are for minified and gzipped code,
computed with the <a href="http://closure-compiler.appspot.com/home" target="_blank">closure compiler</a>.
2016-09-14 01:12:05 -04:00
2016-12-05 07:12:49 -05:00
\* 这些指标测量的是最小化 (minify) 并且 gzip 过的代码,使用 <a href="http://closure-compiler.appspot.com/home" target="_blank">closure compiler</a>
计算出的结果。