下列表格說明每個 Angular 版本所需的 Node.js、TypeScript 與 RxJS 版本。
積極支援中的版本
本表涵蓋積極支援中的 Angular 版本。
| Angular | Node.js | TypeScript | RxJS |
|---|---|---|---|
| 22.x.x | ^22.22.3 || ^24.15.0 || ^26.0.0 | >=6.0.0 <6.1.0 | ^6.5.3 || ^7.4.0 |
| 21.x.x | ^20.19.0 || ^22.12.0 || ^24.0.0 | >=5.9.0 <6.0.0 | ^6.5.3 || ^7.4.0 |
| 20.2.x || 20.3.x | ^20.19.0 || ^22.12.0 || ^24.0.0 | >=5.8.0 <6.0.0 | ^6.5.3 || ^7.4.0 |
| 20.0.x || 20.1.x | ^20.19.0 || ^22.12.0 || ^24.0.0 | >=5.8.0 <5.9.0 | ^6.5.3 || ^7.4.0 |
不再支援的 Angular 版本
本表涵蓋已不在長期支援(LTS)期間內的 Angular 版本。這些資訊在各版本結束 LTS 時是正確的,在此提供但不附帶任何進一步的保證。列在這裡僅供歷史參考。
| Angular | Node.js | TypeScript | RxJS |
|---|---|---|---|
| 19.2.x | ^18.19.1 || ^20.11.1 || ^22.0.0 | >=5.5.0 <5.9.0 | ^6.5.3 || ^7.4.0 |
| 19.1.x | ^18.19.1 || ^20.11.1 || ^22.0.0 | >=5.5.0 <5.8.0 | ^6.5.3 || ^7.4.0 |
| 19.0.x | ^18.19.1 || ^20.11.1 || ^22.0.0 | >=5.5.0 <5.7.0 | ^6.5.3 || ^7.4.0 |
| 18.1.x || 18.2.x | ^18.19.1 || ^20.11.1 || ^22.0.0 | >=5.4.0 <5.6.0 | ^6.5.3 || ^7.4.0 |
| 18.0.x | ^18.19.1 || ^20.11.1 || ^22.0.0 | >=5.4.0 <5.5.0 | ^6.5.3 || ^7.4.0 |
| 17.3.x | ^18.13.0 || ^20.9.0 | >=5.2.0 <5.5.0 | ^6.5.3 || ^7.4.0 |
| 17.1.x || 17.2.x | ^18.13.0 || ^20.9.0 | >=5.2.0 <5.4.0 | ^6.5.3 || ^7.4.0 |
| 17.0.x | ^18.13.0 || ^20.9.0 | >=5.2.0 <5.3.0 | ^6.5.3 || ^7.4.0 |
| 16.1.x || 16.2.x | ^16.14.0 || ^18.10.0 | >=4.9.3 <5.2.0 | ^6.5.3 || ^7.4.0 |
| 16.0.x | ^16.14.0 || ^18.10.0 | >=4.9.3 <5.1.0 | ^6.5.3 || ^7.4.0 |
| 15.1.x || 15.2.x | ^14.20.0 || ^16.13.0 || ^18.10.0 | >=4.8.2 <5.0.0 | ^6.5.3 || ^7.4.0 |
| 15.0.x | ^14.20.0 || ^16.13.0 || ^18.10.0 | ~4.8.2 | ^6.5.3 || ^7.4.0 |
| 14.2.x || 14.3.x | ^14.15.0 || ^16.10.0 | >=4.6.2 <4.9.0 | ^6.5.3 || ^7.4.0 |
| 14.0.x || 14.1.x | ^14.15.0 || ^16.10.0 | >=4.6.2 <4.8.0 | ^6.5.3 || ^7.4.0 |
| 13.3.x || 13.4.x | ^12.20.0 || ^14.15.0 || ^16.10.0 | >=4.4.3 <4.7.0 | ^6.5.3 || ^7.4.0 |
| 13.1.x || 13.2.x | ^12.20.0 || ^14.15.0 || ^16.10.0 | >=4.4.3 <4.6.0 | ^6.5.3 || ^7.4.0 |
| 13.0.x | ^12.20.0 || ^14.15.0 || ^16.10.0 | ~4.4.3 | ^6.5.3 || ^7.4.0 |
| 12.2.x | ^12.14.0 || ^14.15.0 | >=4.2.3 <4.4.0 | ^6.5.3 || ^7.0.0 |
| 12.1.x | ^12.14.0 || ^14.15.0 | >=4.2.3 <4.4.0 | ^6.5.3 |
| 12.0.x | ^12.14.0 || ^14.15.0 | ~4.2.3 | ^6.5.3 |
| 11.2.x | ^10.13.0 || ^12.11.0 | >=4.0.0 <4.2.0 | ^6.5.3 |
| 11.1.x | ^10.13.0 || ^12.11.0 | >=4.0.0 <4.2.0 | ^6.5.3 |
| 11.0.x | ^10.13.0 || ^12.11.0 | ~4.0.0 | ^6.5.3 |
| 10.2.x | ^10.13.0 || ^12.11.0 | >=3.9.0 <4.1.0 | ^6.5.3 |
| 10.1.x | ^10.13.0 || ^12.11.0 | >=3.9.0 <4.1.0 | ^6.5.3 |
| 10.0.x | ^10.13.0 || ^12.11.0 | ~3.9.0 | ^6.5.3 |
| 9.1.x | ^10.13.0 || ^12.11.0 | >=3.6.0 <3.9.0 | ^6.5.3 |
| 9.0.x | ^10.13.0 || ^12.11.0 | >=3.6.0 <3.8.0 | ^6.5.3 |
v9 之前
在 Angular v9 之前,Angular 與 Angular CLI 的版本並未同步。
| Angular | Angular CLI | Node.js | TypeScript | RxJS |
|---|---|---|---|---|
| 8.2.x | 8.2.x || 8.3.x | ^10.9.0 | >=3.4.2 <3.6.0 | ^6.4.0 |
| 8.0.x || 8.1.x | 8.0.x || 8.1.x | ^10.9.0 | ~3.4.2 | ^6.4.0 |
| 7.2.x | 7.2.x || 7.3.x | ^8.9.0 || ^10.9.0 | >=3.1.3 <3.3.0 | ^6.0.0 |
| 7.0.x || 7.1.x | 7.0.x || 7.1.x | ^8.9.0 || ^10.9.0 | ~3.1.3 | ^6.0.0 |
| 6.1.x | 6.1.x || 6.2.x | ^8.9.0 | >=2.7.2 <3.0.0 | ^6.0.0 |
| 6.0.x | 6.0.x | ^8.9.0 | ~2.7.2 | ^6.0.0 |
| 5.2.x | 1.6.x || 1.7.x | ^6.9.0 || ^8.9.0 | >=2.4.2 <2.7.0 | ^5.5.0 |
| 5.0.x || 5.1.x | 1.5.x | ^6.9.0 || ^8.9.0 | ~2.4.2 | ^5.5.0 |
| 4.2.x || 4.3.x || 4.4.x | 1.4.x | ^6.9.0 || ^8.9.0 | >=2.1.6 <2.5.0 | ^5.0.1 |
| 4.2.x || 4.3.x || 4.4.x | 1.3.x | ^6.9.0 | >=2.1.6 <2.5.0 | ^5.0.1 |
| 4.0.x || 4.1.x | 1.0.x || 1.1.x || 1.2.x | ^6.9.0 | >=2.1.6 <2.4.0 | ^5.0.1 |
| 2.x | - | ^6.9.0 | >=1.8.0 <2.2.0 | ^5.0.1 |
瀏覽器支援
Angular 使用「widely available」Baseline 來定義瀏覽器支援。對每個主要版本,Angular 支援的瀏覽器,是在接近該主要版本發布日期所選定日期的 Baseline 中包含的瀏覽器。
「widely available」Baseline 包含在所選日期之前 30 個月(2.5 年)內發布的瀏覽器,範圍限於 Baseline 的核心瀏覽器集合(Chrome、Edge、Firefox、Safari),目標是涵蓋約 95% 的 Web 使用者。
v20 之前的 Angular 版本支援下列特定的瀏覽器版本:
| 瀏覽器 | 支援的版本 |
|---|---|
| Chrome | 最近 2 個版本 |
| Firefox | 最新版與延伸支援版本(ESR) |
| Edge | 最近 2 個主要版本 |
| Safari | 最近 2 個主要版本 |
| iOS | 最近 2 個主要版本 |
| Android | 最近 2 個主要版本 |
Polyfill
Angular 建立在 Web 平台的最新標準之上。 要支援如此廣泛的瀏覽器是很有挑戰性的,因為它們並不支援現代瀏覽器的所有功能。 你可以為必須支援的瀏覽器載入 polyfill 指令稿(「polyfills」)來彌補這一點。 如何將 polyfill 加入你的專案,請參閱下方說明。
IMPORTANT: 建議的 polyfill 是能執行完整 Angular 應用程式的那些。 你可能需要額外的 polyfill,才能支援此清單未涵蓋的功能。
HELPFUL: Polyfill 沒有辦法神奇地把舊的、慢的瀏覽器變成現代的、快速的瀏覽器。
在 CLI 專案中啟用 polyfill
Angular CLI 提供對 polyfill 的支援。 如果你不是使用 CLI 來建立你的專案,請參閱非 CLI 使用者的 polyfill 說明。
瀏覽器與測試建置器 的 polyfills 選項可以是一個檔案的完整路徑(例如:src/polyfills.ts),或相對於目前工作區的路徑或模組指定符(例如:zone.js)。
如果你建立一個 TypeScript 檔案,請確保將它包含在你的 tsconfig 檔案的 files 屬性中。
{
"extends": "./tsconfig.json",
"compilerOptions": {
...
},
"files": [
"src/main.ts",
"src/polyfills.ts"
]
...
}
非 CLI 使用者的 polyfill
如果你不是使用 CLI,請將你的 polyfill 指令稿直接加入主機網頁(index.html)。
例如:
src/index.html
<!-- pre-zone polyfills -->
<script src="node_modules/core-js/client/shim.min.js"></script>
<script>
/**
* you can configure some zone flags which can disable zone interception for some
* asynchronous activities to improve startup performance - use these options only
* if you know what you are doing as it could result in hard to trace down bugs.
*/
// __Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
// __Zone_disable_on_property = true; // disable patch onProperty such as onclick
// __zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
/*
* in Edge developer tools, the addEventListener will also be wrapped by zone.js
* with the following flag, it will bypass `zone.js` patch for Edge.
*/
// __Zone_enable_cross_context_check = true;
</script>
<!-- zone.js required by Angular -->
<script src="node_modules/zone.js/bundles/zone.umd.js"></script>
<!-- application polyfills -->