block includes include ../_util-fns - var _at_angular = '@angular' :marked # Browser support # # 浏览器支持 # Angular supports most recent browsers. This includes the following specific versions: Angular支持大多数常用浏览器,包括下列版本: table tr th Chrome th Firefox th Edge th IE th Safari th iOS th Android th IE mobile tr td 最新版 td 最新版 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
(5.0, 5.1) td tr td td td td 9 td 8 td 8 td KitKat
(4.4) td tr td td td td td 7 td 7 td Jelly Bean
(4.1, 4.2, 4.3) td .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 SauceLabs and Browserstack. Angular在持续集成过程中,对每一个提交都会使用SauceLabsBrowserstack在上述所有浏览器上执行单元测试。 :marked # 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 compensate by loading polyfill scripts ("polyfills") on the host web page (`index.html`) that implement missing features in JavaScript. 你可以通过在宿主页面(`index.html`)中加载填充脚本(“polyfills”)来加以弥补,这些脚本实现了浏览器缺失的JavaScript特性。 +makeExample('quickstart/ts/index.html', 'polyfills')(format='.') :marked 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 will help you determine which polyfills to load, depending on the browsers you target and the features you use. 下表将帮你决定该加载哪些填充库,具体取决于目标浏览器和要用到的特性。 .alert.is-important :marked The suggested polyfills are the ones we know will 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。 :marked ## Mandatory polyfills ## ## 强制性填充库 ## These are the polyfills required to run an Angular application on each supported browser: 下表是填充库对每个支持的浏览器都是需要的: table tr(style="vertical-align: top") th p Browsers (desktop & mobile) p 浏览器(桌面 & 移动) th p Polyfills required p 需要的填充库 tr(style="vertical-align: top") td Chrome, Firefox, Edge, Safari 9+ td None tr(style="vertical-align: top") td Safari 7 & 8, IE10 & 11, Android 4.1+ td :marked [ES6](#core-es6) tr(style="vertical-align: top") td IE9 td :marked [ES6
classList](#classlist) :marked ## 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. 比如,动画库依赖于标准的动画API,目前它只在Chrome和Firefox上可用。你可能需要一个填充库来在其它浏览器上使用动画功能。 Here are the features which may require additional polyfills: 下列特性可能需要更多填充库: table tr(style="vertical-align: top") th p Feature p 特性 th p Polyfill p 填充库 th(style="width: 50%") p Browsers (desktop & mobile) p 浏览器(桌面 & 移动) tr(style="vertical-align: top") td a(href="./animations.html") Animations a(href="./animations.html") 动画 td :marked [Web Animations](#web-animations) [Web Animations](#web-animations) td p All but Chrome and Firefox
Not supported in IE9 p 除Chrome和Firefox外的所有,但不支持IE9 tr(style="vertical-align: top") td 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 和 a(href="../api/common/index/PercentPipe-pipe.html" target="_blank") percent span 管道 td :marked [Intl API](#intl) td All but Chrome, Firefox, Edge, IE11 and Safari 10 td p All but Chrome, Firefox, Edge, E11 and Safari 10 p 除了Chrome、Firefox、Edge、IE11和Safari 10外的所有浏览器 tr(style="vertical-align: top") td p a(href="../api/common/index/NgClass-directive.html" target="_blank") NgClass span on SVG elements p | 在SVG元素上用 a(href="../api/common/index/NgClass-directive.html" target="_blank") NgClass td :marked [classList](#classlist) td IE10, IE11 tr(style="vertical-align: top") td p a(href="./server-communication.html") Http span when sending and receiving binary data p span 用 a(href="./server-communication.html") Http span 发送和接受二进制数据 td :marked [Typed Array](#typedarray)
[Blob](#blob)
[FormData](#formdata) td IE 9 :marked ## Suggested polyfills ## ## 建议的填充库 ## Below are the polyfills which are used to test the framework itself. They are a good starting point for an application. 下表中是用来测试框架本身的填充库,它们是应用程序的优质起点。 table tr th p Polyfill p 填充库 th p Licence p 授权方式 th p Size* p 大小* tr td a#core-es6(href="https://github.com/zloirock/core-js" target="_blank") ES6 td MIT td 27.4KB tr td a#classlist(href="https://github.com/eligrey/classList.js" target="_blank") classList td p Public domain p 公共域 td 1KB tr td a#intl(href="https://github.com/andyearnshaw/Intl.js" target="_blank") Intl td MIT / Unicode licence td 13.5KB tr td p a(href="https://github.com/web-animations/web-animations-js" target="_blank") Web Animations p a#web-animations(href="https://github.com/web-animations/web-animations-js" target="_blank") Web Animations td Apache td 14.8KB tr td p a(href="https://github.com/inexorabletash/polyfill/blob/master/typedarray.js" target="_blank") Typed Array p a#typedarray(href="https://github.com/inexorabletash/polyfill/blob/master/typedarray.js" target="_blank") Typed Array td MIT td 4KB tr td a#blob(href="https://github.com/eligrey/Blob.js" target="_blank") Blob td MIT td 1.3KB tr 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 closure compiler * 这些指标测量的是最小化(minify)并且gzip过的代码,使用closure compiler计算出的结果。