Angular has traditionally relied on Zone.js to detect asynchronous activity and determine when the application might need to update its UI.
But that approach is changing.
With Angular 21, zoneless change detection became the default for new applications. Angular 22 took another step by making OnPush the default change-detection strategy for new applications.
Together, these changes represent a shift toward more explicit and efficient rendering, where Angular can identify which components actually need updating instead of relying on broad change-detection cycles.
Understanding both changes is important, particularly when building new Angular applications or upgrading existing projects.
1. How Angular Change Detection Worked Before
Change detection is the process Angular uses to keep the application UI synchronized with its underlying data.
Consider a component displaying a user's name.
When that name changes, Angular needs to identify the change and update the corresponding part of the DOM.
Traditionally, Angular used Zone.js to help detect when asynchronous operations might have changed application state.
Zone.js works by patching browser APIs such as timers, event listeners, and asynchronous operations. When relevant asynchronous activity completes, Angular can schedule change detection.
The traditional workflow looks like this:
- A user clicks a button or an asynchronous operation completes.
- Zone.js detects the relevant activity.
- Angular schedules change detection.
- Angular checks the component tree to determine which views need updating.
- The browser displays the updated UI.
The limitation is that Zone.js does not know whether application data actually changed. It only knows that an operation occurred.
Consequently, Angular could perform change-detection work even when no meaningful UI update was necessary.
For large applications, reducing this unnecessary work becomes valuable.
2. Angular 21: Zoneless Change Detection Becomes the Default
Angular 21 changed the default setup for new applications by removing Zone.js from the default configuration.
Zoneless change detection was not entirely new. It was introduced experimentally in Angular 18, reached Developer Preview in Angular 20, and became stable in Angular 20.2 before becoming the default in Angular 21.
Instead of relying on Zone.js to detect asynchronous activity, Angular uses explicit framework notifications to schedule application updates.
These notifications include:
- Updating a signal read by a component template.
- Calling
ChangeDetectorRef.markForCheck(). - Setting a component input through
ComponentRef.setInput(). - Handling a bound host or template event.
- Attaching a view that has been marked for checking.
This allows Angular to respond to known state changes without depending on Zone.js to observe every asynchronous operation.
The important distinction is that zoneless does not mean change detection disappears. Angular still performs change detection, but its scheduling mechanism changes.
3. How Signals Help Zoneless Angular
Signals are an important part of modern Angular reactivity.
A signal represents a value that Angular can track. When a component template reads a signal, Angular knows that the component depends on that value.
When the signal changes, Angular can schedule the affected component for an update.
Consider this example:
import { Component, signal } from '@angular/core';
@Component({
selector: 'app-counter',
template: `
<h2>Count: {{ count() }}</h2>
<button (click)="increment()">
Increment
</button>
`
})
export class CounterComponent {
count = signal(0);
increment() {
this.count.update(value => value + 1);
}
}
The template reads count().
When the button is clicked, increment() updates the signal. Angular receives the notification and schedules the necessary UI update.
This is different from relying on an asynchronous operation merely completing and hoping Angular will detect a change.
Signals are not the only way to notify Angular. Events, markForCheck(), and other supported framework APIs can also schedule updates.
However, signals provide a convenient way to make application state reactive.
4. Angular 22: OnPush Becomes the Default
Angular 21 introduced zoneless as the default for new applications. Angular 22 extended this direction by changing the default component change-detection strategy.
Previously, Angular components used ChangeDetectionStrategy.Default unless developers explicitly selected OnPush.
Starting with Angular 22, new applications use OnPush by default.
Compare the approaches:
Previous default:
@Component({
selector: 'app-user',
template: `<h2>{{ username }}</h2>`
})
export class UserComponent {
username = 'Navneet';
}
The component previously used the default eager change-detection strategy because no strategy was specified.
Angular 22 default:
The same component now uses OnPush automatically in a new Angular 22 application.
Developers no longer need to explicitly write:
changeDetection: ChangeDetectionStrategy.OnPush
when using the new default.
OnPush helps Angular skip component subtrees when they do not need checking. A component is checked when relevant conditions occur, including:
- It receives a new input through a template binding.
- An event is handled within its subtree.
- It is explicitly marked for checking.
- A signal read by its template changes.
This makes component updates more targeted.
Angular 22 also renamed ChangeDetectionStrategy.Default to ChangeDetectionStrategy.Eager. The old Default value remains a deprecated alias for Eager.
5. Why Zoneless and OnPush Work Well Together
These changes are related, but they solve different parts of the rendering process.
Zoneless controls how Angular schedules change detection.
OnPush controls which component subtrees Angular needs to check.
Consider a dashboard containing hundreds of components.
A user updates one widget.
With more targeted change detection, Angular can respond to the relevant notification and refresh the affected component subtree without unnecessarily checking every component in the application.
Signals make this approach particularly useful because Angular can track which templates depend on which values.
The combination encourages developers to write applications where state changes and UI updates have a clearer relationship.
However, this is not a guarantee that every application becomes faster automatically. Actual performance depends on component design, rendering work, data updates, and application architecture.
6. What Existing Angular Applications Need to Know
These changes are important for developers upgrading existing projects.
An application created several Angular versions ago may depend on Zone.js and eager change detection throughout its component tree.
Upgrading should therefore be treated as a migration, not simply a package update.
Angular's v22 migration preserves the previous eager behaviour for existing components that relied on the implicit default by adding an explicit ChangeDetectionStrategy.Eager setting where necessary.
This avoids silently changing their rendering behaviour during the upgrade.
A sensible migration process is:
Step 1: Upgrade Angular
Use Angular's official update tooling to move to the supported version.
Step 2: Inspect change-detection configuration
Review existing ChangeDetectionStrategy.Default and Eager settings, as well as changes introduced by the migration.
Step 3: Review component state
Identify components that update ordinary class properties from subscriptions, callbacks, or third-party libraries without notifying Angular.
Step 4: Introduce reactive notifications
Use signals, AsyncPipe, or ChangeDetectorRef.markForCheck() where appropriate.
Step 5: Verify Zone.js dependencies
Check angular.json, polyfill imports, and third-party libraries before removing Zone.js from the build.
Some libraries may still rely on Zone.js APIs or NgZone stability events.
Step 6: Test the application
Test asynchronous updates, forms, event handling, third-party integrations, and component rendering under zoneless conditions.
Do not remove compatibility mechanisms until the application and its dependencies have been verified.
7. Common Problems Developers May Encounter
Moving toward zoneless and OnPush rendering changes some assumptions in older Angular code.
A few problems deserve particular attention.
Plain property updates do not automatically notify Angular
An asynchronous callback might update a class property without triggering a supported change-detection notification.
Using a signal or calling markForCheck() provides an explicit way to notify Angular.
Mutating objects can prevent expected updates
Consider a parent passing an object to an OnPush child.
If the parent modifies the existing object without creating a new reference, the child may not receive a changed input according to Angular's input comparison.
Prefer immutable updates that create a new object reference.
Third-party libraries may depend on Zone.js
Some libraries assume Zone.js is present or use NgZone events to detect application stability.
Review their compatibility before migrating.
Tests may hide missing notifications
Manually calling fixture.detectChanges() can force an update that the actual application would not have scheduled.
Tests should verify that application state changes produce the correct Angular notifications.
Conclusion
Angular 21 and 22 represent important changes to how Angular applications manage UI updates.
Angular 21 made zoneless change detection the default for new applications, removing the default dependency on Zone.js. Angular 22 followed with OnPush as the default change-detection strategy for new applications.
Signals make these changes easier to work with by providing explicit, trackable application state.
For developers, the bigger shift is toward more predictable state updates and targeted rendering rather than relying on broad change-detection cycles.
Angular is moving toward a rendering model where applications make their state changes explicit, and the framework can respond more precisely to what actually needs updating.
Official references
- Angular v21 announcement: https://blog.angular.dev/announcing-angular-v21-57946c34f14b
- Angular v22 announcement: https://blog.angular.dev/announcing-angular-v22-c52bb83a4664
- Angular zoneless guide: https://angular.dev/guide/zoneless
- Angular OnPush documentation: https://angular.dev/best-practices/skipping-subtrees
- Angular change-detection API: https://angular.dev/api/core/ChangeDetectionStrategy



