Skip to content
ToolShedby Wasim Shaikh

Angular Upgrade Planner

Pick a source and target Angular version (8–22) for an ordered, checkable upgrade plan — ng update commands, breaking changes, deprecations, and migrations.

Choose your upgrade path

Angular 20 → Angular 220 of 26 done · 2 hops
1

Angular 20 → Angular 21

(9 steps)
Pre-flight

Commit or stash all work, then make sure you are on the latest minor/patch of your current major before running ng update. Upgrade exactly one major at a time and run the app/tests after each hop.

Tooling / Requirements

Angular 21 requires Node.js 20.19+, 22.12+, or 24, and TypeScript 5.9 (up to <6.0).

Check your Node.js & TypeScript versions for Angular 21 →
Update Command

Update the core framework and CLI together. This applies the official automatic migration schematics for this version.

ng update @angular/core@21 @angular/cli@21
Breaking Change

Applications are zoneless unless they provide Zone.js change detection. The ng update migration adds provideZoneChangeDetection() to existing apps so they keep working; review code that relies on Zone.js patching before removing it.

Breaking Change

New projects use Vitest. Existing projects keep Karma, which is still supported (new projects can opt in with --test-runner=karma). The experimental Jest and Web Test Runner builders are slated for removal in v22.

Convert Jasmine specs to Vitest online →
Breaking Change

typeCheckHostBindings is now on by default, so invalid host binding and @HostBinding/@HostListener expressions become compile errors. Fix what the compiler flags, or turn the option off temporarily.

Migration / Adoption

HttpClient is available from the root injector without calling provideHttpClient(). Keep provideHttpClient() when you need interceptors or features such as withFetch().

Migration / Adoption

Angular now recommends native [class] and [style] bindings over NgClass and NgStyle, and provides migrations for both.

ng generate @angular/core:ngclass-to-class
Migration / Adoption

Signal Forms ship as an experimental API — a signal-based alternative to reactive forms. Try it in non-critical areas; it becomes stable in v22.

Sources: Angular Update Guide: v20 → v21 · Angular 21.0.0 release notes · Announcing Angular v21 (Angular Blog)

2

Angular 21 → Angular 22

(17 steps)
Pre-flight

Commit or stash all work, then make sure you are on the latest minor/patch of your current major before running ng update. Upgrade exactly one major at a time and run the app/tests after each hop.

Tooling / Requirements

Angular 22 requires TypeScript 6.0 (5.9 and below are no longer supported) and Node.js ^22.22.3, ^24.15.0 or 26.0.0 and newer. Node 20 is dropped, and earlier Node 22/24 releases are below the minimum. Upgrade your toolchain before updating.

Check your Node.js & TypeScript versions for Angular 22 →
Update Command

Update the core framework and CLI together. This applies the official automatic migration schematics for this version.

ng update @angular/core@22 @angular/cli@22
Breaking Change

A component without changeDetection now uses OnPush, and the old Default strategy is renamed Eager. The ng update migration adds changeDetection: ChangeDetectionStrategy.Eager to existing components, so behavior is preserved. Remove Eager component by component as you move to signals.

Breaking Change

Route parameters and data are now inherited from all parent routes by default. There is no migration: set paramsInheritanceStrategy: 'emptyOnly' in withRouterConfig() to keep the old behavior, or review components that read route params/data.

Breaking Change

HttpClient now uses fetch instead of XMLHttpRequest. The migration removes withFetch() calls, or adds withXhr() where you need XHR behavior such as upload progress events. reportProgress is deprecated in favor of reportUploadProgress and reportDownloadProgress.

Breaking Change

In templates, a?.b now returns undefined instead of null when a is null or undefined, matching TypeScript. The migration wraps affected expressions in $safeNavigationMigration() to keep the old result; check code that compares with === null.

Breaking Change

strictTemplates is enabled by default, so stricter template type errors can appear. canMatch guards receive a required currentSnapshot parameter (migrated automatically). The experimental Jest and Web Test Runner builders are removed.

Breaking Change

ComponentFactoryResolver and ComponentFactory are gone: pass the component class to ViewContainerRef.createComponent() or use createComponent(). Also removed: createNgModuleRef (use createNgModule), ChangeDetectorRef.checkNoChanges (call fixture.detectChanges() in tests), provideRoutes() (use provideRouter() or the ROUTES token), the built-in Hammer.js integration, and getAngularLib/setAngularLib in @angular/upgrade (use getAngularJSGlobal/setAngularJSGlobal). There is no migration for these, so search your code and libraries before updating.

Breaking Change

data- prefixed attributes no longer bind to inputs or outputs. Binding an input, output or model to the same name twice is an error (the migration fixes duplicate model outputs). An element matched by more than one component selector fails at compile time. The nullishCoalescingNotNullable and optionalChainNotNullable diagnostics now fire on more code, and the migration turns them off in tsconfig so you can clean up gradually.

Breaking Change

provideClientHydration() enables incremental hydration by default; the migration adds withNoIncrementalHydration() where you hadn't opted in, to keep the old behavior. A request whose Host header fails validation now gets a 400 response instead of falling back to client-side rendering, so list every domain in allowedHosts. A migration adds the new trustProxyHeaders setting to AngularNodeAppEngine/AngularAppEngine.

Breaking Change

ng serve now gives the PORT environment variable top priority, overriding angular.json and --port. istanbul-lib-instrument is now an optional peer dependency; ng update adds it when Karma is used, but check it is installed if you run Karma with coverage. The architect CLI moved from @angular-devkit/architect-cli into @angular-devkit/architect.

Deprecation / Removal

The Webpack builders in @angular-devkit/build-angular and @ngtools/webpack are deprecated (use @angular/build). CommonEngine is deprecated in favor of AngularNodeAppEngine/AngularAppEngine. HttpClient JSONP support is deprecated (22.1). The ng-packagr builder is deprecated in favor of @angular/build:library (22.3). The testRunner option is deprecated, and new projects will only use Vitest in a future version (22.3). Deprecated APIs can be removed in the next major, so fix the warnings during the 22.x cycle.

Migration / Adoption

These migrations do not run by default. migrate-karma-to-vitest moves a Karma project to the Vitest unit-test builder, use-application-builder moves off the deprecated Webpack builders, and use-library-builder (22.3+) switches libraries from ng-packagr to @angular/build:library. Run each one on its own commit.

Convert Jasmine specs to Vitest online →
ng update @angular/cli --name migrate-karma-to-vitest
ng update @angular/cli --name use-application-builder
ng update @angular/cli --name use-library-builder
Migration / Adoption

ng update @angular/core@22 installs the latest minor (22.3 as of November 2026). It adds HttpClient.query() for HTTP QUERY requests, route error boundaries and reactive route resources, stable router view transitions, scrollMargin for @defer viewport triggers, increment/decrement operators in template expressions, ErrorBoundary APIs and @boundary blocks (22.2), and an @Injectable → @Service migration (22.1).

Migration / Adoption

Signal Forms are stable, resource()/rxResource()/httpResource() are production-ready, and the @angular/aria headless accessibility package leaves developer preview.

Reactive Forms → Signal Forms reference →
Migration / Adoption

@Service() is a shorter @Injectable({ providedIn: 'root' }) for classes that use inject(). It doesn't support constructor injection, so migrate constructors first, then switch services. @Injectable still works, so this is optional.

Convert constructors to inject() and @Service() online →
ng generate @angular/core:inject
ng generate @angular/core:service

Sources: Angular Update Guide: v21 → v22 · Angular 22.0.0 release notes · Announcing Angular v22 (Angular Blog)

Tip: Upgrade one major at a time and run ng update for each hop — it applies the official migration schematics automatically. Commit between hops and run your tests. This is a representative checklist of the major changes; always confirm specifics against the official Angular Update Guide for your exact versions.

Upgrading Angular 20 to Angular 22

This plan covers the full path from Angular 20 to Angular 22 — 2 version hops and 26 steps in total. Upgrade one major at a time, running ng update for each hop so the official migration schematics apply. Commit and run your tests between hops.

Breaking changes to check between Angular 20 and Angular 22

  • Zoneless change detection is the default (Angular 20 → Angular 21): Applications are zoneless unless they provide Zone.js change detection. The ng update migration adds provideZoneChangeDetection() to existing apps so they keep working; review code that relies on Zone.js patching before removing it.
  • Vitest replaces Karma as the default test runner (Angular 20 → Angular 21): New projects use Vitest. Existing projects keep Karma, which is still supported (new projects can opt in with --test-runner=karma). The experimental Jest and Web Test Runner builders are slated for removal in v22.
  • Host bindings are type-checked by default (Angular 20 → Angular 21): typeCheckHostBindings is now on by default, so invalid host binding and @HostBinding/@HostListener expressions become compile errors. Fix what the compiler flags, or turn the option off temporarily.
  • OnPush is the default change detection strategy (Angular 21 → Angular 22): A component without changeDetection now uses OnPush, and the old Default strategy is renamed Eager. The ng update migration adds changeDetection: ChangeDetectionStrategy.Eager to existing components, so behavior is preserved. Remove Eager component by component as you move to signals.
  • Route paramsInheritanceStrategy defaults to 'always' (Angular 21 → Angular 22): Route parameters and data are now inherited from all parent routes by default. There is no migration: set paramsInheritanceStrategy: 'emptyOnly' in withRouterConfig() to keep the old behavior, or review components that read route params/data.
  • HttpClient uses the Fetch API by default (Angular 21 → Angular 22): HttpClient now uses fetch instead of XMLHttpRequest. The migration removes withFetch() calls, or adds withXhr() where you need XHR behavior such as upload progress events. reportProgress is deprecated in favor of reportUploadProgress and reportDownloadProgress.
  • Template optional chaining returns undefined (Angular 21 → Angular 22): In templates, a?.b now returns undefined instead of null when a is null or undefined, matching TypeScript. The migration wraps affected expressions in $safeNavigationMigration() to keep the old result; check code that compares with === null.
  • Long-deprecated APIs are removed (Angular 21 → Angular 22): ComponentFactoryResolver and ComponentFactory are gone: pass the component class to ViewContainerRef.createComponent() or use createComponent(). Also removed: createNgModuleRef (use createNgModule), ChangeDetectorRef.checkNoChanges (call fixture.detectChanges() in tests), provideRoutes() (use provideRouter() or the ROUTES token), the built-in Hammer.js integration, and getAngularLib/setAngularLib in @angular/upgrade (use getAngularJSGlobal/setAngularJSGlobal). There is no migration for these, so search your code and libraries before updating.
  • Stricter template compiler checks (Angular 21 → Angular 22): data- prefixed attributes no longer bind to inputs or outputs. Binding an input, output or model to the same name twice is an error (the migration fixes duplicate model outputs). An element matched by more than one component selector fails at compile time. The nullishCoalescingNotNullable and optionalChainNotNullable diagnostics now fire on more code, and the migration turns them off in tsconfig so you can clean up gradually.
  • SSR: incremental hydration on by default, stricter Host checks (Angular 21 → Angular 22): provideClientHydration() enables incremental hydration by default; the migration adds withNoIncrementalHydration() where you hadn't opted in, to keep the old behavior. A request whose Host header fails validation now gets a 400 response instead of falling back to client-side rendering, so list every domain in allowedHosts. A migration adds the new trustProxyHeaders setting to AngularNodeAppEngine/AngularAppEngine.

Hops in this path

  1. Angular 20 → Angular 21 — 9 steps
  2. Angular 21 → Angular 22 — 17 steps

Before you start

  • Commit or stash your work and upgrade on a branch so you can roll back.
  • Get on the latest minor/patch of Angular 20 before the first hop.
  • Update third-party libraries (including Angular Material/CDK) alongside each hop, and run your tests after each one.

Sources

Every step in this plan is checked against Angular's official documentation and release notes. Last reviewed .