Commit bd21e00
feat(angular): support Angular 22 (#31205)
Issue number: resolves #31204
---------
## What is the current behavior?
Currently, `@ionic/angular` on `major-9.0` supports Angular 18 through
21 and TypeScript 5.4 through 5.9. The library and
`@ionic/angular-server` don't build under Angular 22 / ng-packagr 22 /
TypeScript 6.0. TS 6.0 surfaces latent `tsconfig` problems (a `baseUrl`
the schematics build relied on, and `types` now defaulting to `[]`), and
Angular 22's `typeCheckHostBindings` rejects the `$event.target` host
bindings in `ion-tabs` and the multi-element value accessors. The
package also still lints with ESLint 8 and the legacy `.eslintrc.json`
## What is the new behavior?
This extends the supported Angular range to 18 through 22 and upgrades
TypeScript to v6.0. A new `ng22` test app is added, mirroring `ng21`
(zoneless), so the automated test matrix covers v18-22 end to end
The package's ESLint setup is migrated to the v9 flat config, which was
required by the upgrade to `angular-eslint@22`
Several shared test pages under `test/base/` were modernized to signals
(router-link, checkbox, the value-accessor display, and the lazy modal
example). Angular 22 defaults components without an explicit strategy to
`OnPush`, so plain-field state mutated from an Ionic lifecycle hook no
longer re-renders on its own in the test app
## Does this introduce a breaking change?
- [X] Yes
- [ ] No
Apps moving to Angular 22 inherit three Angular 22 requirements, all
documented in BREAKING.md: components without an explicit change
detection strategy default to `OnPush` (run `ng update` to migrate to
eager, or use a signal / `markForCheck()` for state set in lifecycle
hooks), TypeScript 6.0 or later is required, and the minimum Node.js
version rises to `^22.22.3 || ^24.15.0 || ^26.0.0`. Angular 18 through
21 are unaffected
## Other information
Angular 22's CLI hard-blocks Node below `^24.15.0` / `^22.22.3` /
`>=26`, so local `ng serve` / `ng test` of the `ng22` app needs a Node
version in that range
---------
## Current dev build (2026-06-10):
```
8.8.9-dev.11781098612.122c6758
```
Angular 22 test app:
https://ionic-framework-git-feat-ng22-ionic1.vercel.app/angular/
Docs PR: ionic-team/ionic-docs#4549
Docs Preview:
https://ionic-docs-git-feat-ng22-ionic1.vercel.app/docs/updating/9-0#angular
---------
Co-authored-by: Brandy Smith <brandyscarney@users.noreply.github.com>1 parent 9d9a1cc commit bd21e00
66 files changed
Lines changed: 18878 additions & 1932 deletions
File tree
- .github/workflows
- packages
- angular-server
- angular
- common/src
- overlays
- providers
- src
- directives
- control-value-accessors
- validators
- schematics
- add
- utils
- test
- apps/ng22
- src
- base
- src/app
- lazy
- modal-example
- router-link-page
- router-link
- template-form
- validators
- standalone/value-accessors
- checkbox
- value-accessor-test
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
| 143 | + | |
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
160 | | - | |
| 160 | + | |
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
178 | 182 | | |
179 | 183 | | |
180 | | - | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
181 | 189 | | |
182 | 190 | | |
183 | 191 | | |
| |||
0 commit comments