版本相容性

edit

下表描述了每個 Angular 版本所需的 Node.js、TypeScript 和 RxJS 版本。

處於積極支援的版本

此表涵蓋處於積極支援的 Angular 版本

Angular Node.js TypeScript RxJS
20.2.x || 20.3.x ^20.19.0 || ^22.12.0 || ^24.0.0 >=5.9.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
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

不受支援的 Angular 版本

此表涵蓋了不再處於長期支援 (LTS) 的 Angular 版本。當每個版本退出 LTS 時,此訊息是正確的,並且不提供任何進一步的保證。此處列出以供歷史參考。

Angular Node.js TypeScript RxJS
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 使用 『廣泛可用』基線來定義瀏覽器支援。對於每個主版本,Angular 支援在選定的日期接近該主版本發布日期時包含在基線中的瀏覽器。

『廣泛可用』基線包括在選定日期(在基線核心瀏覽器集(Chrome、Edge、Firefox、Safari)內)前 30 個月(2.5 年)內發布的瀏覽器,並以支援約 95% 的網路使用者為目標。

Angular 基線日期 瀏覽器集
v20 2025-04-30 瀏覽器集

v20 之前的 Angular 版本支援以下特定瀏覽器版本:

瀏覽器 支援的版本
Chrome 瀏覽器 最近 2 個版本
Firefox 瀏覽器 最新版和擴充套件支援版本 (ESR)
Edge 瀏覽器 最近 2 個主要版本
Safari 瀏覽器 最近 2 個主要版本
iOS 最近 2 個主要版本
Android 最近 2 個主要版本

膩子指令碼

Angular 建立於最新的 Web 平台標準之上。 定位如此廣泛的瀏覽器具有挑戰性,因為它們並非都支援現代瀏覽器的所有屬性。 你需要為你必須支援的瀏覽器載入膩子指令碼(『polyfills』)來彌補。 請參閱下面的說明,瞭解如何將膩子指令碼包含到你的專案中。

重點: 建議的膩子指令碼是那些執行完整的 Angular 應用的指令碼。 你可能需要額外的膩子指令碼來支援此清單未涵蓋的屬性。

提示: 膩子指令碼無法神奇地將舊的、慢速的瀏覽器轉換為現代的、快速的瀏覽器。

在 CLI 專案中啟用膩子指令碼

Angular CLI 提供了對膩子指令碼的支援。 如果你沒有使用 CLI 來建立專案,請參閱非 CLI 使用者的膩子指令碼說明

瀏覽器和測試建構式polyfills 選項可以是檔案的完整路徑(範例:src/polyfills.ts),也可以是相對於當前工作區或模組識別符號的路徑(範例:zone.js)。

如果你建立了一個 TypeScript 檔案,請確保將其包含在 tsconfig 檔案的 files 屬性中。

{  "extends": "./tsconfig.json",  "compilerOptions": {    ...  },  "files": [    "src/main.ts",    "src/polyfills.ts"  ]  ...}

非 CLI 使用者的膩子指令碼

如果你沒有使用 CLI,請將你的膩子指令碼直接新增到宿主網頁 (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 -->