DEV Community

Cover image for ⭐ Angular 22 Features ⭐
Sandeep Balachandran
Sandeep Balachandran

Posted on

⭐ Angular 22 Features ⭐

Hey there,

Angular 22 is officially here! Well, not today. Back in June 2026

TL;DR 🙌

✅ Signal Forms are now stable

✅ resource, rxResource & httpResource are now stable

✅ Angular Aria is now stable

✅ OnPush is the default change detection strategy

✅ HttpClient uses Fetch by default

✅ New @Service() decorator & injectAsync()

✅ Template upgrades: spread, arrow functions, instanceof, multiple @case

✅ Angular Agent Skills & experimental WebMCP

✅ Requires TypeScript 6, drops Node 20

How to update to version 22

Visit angular.dev/update-guide for detailed information and guidance. To have the best update experience,

Update to 22

ng update @angular/cli @angular/core
Enter fullscreen mode Exit fullscreen mode

In order to update your global angular,

npm i -g @angular/cli
Enter fullscreen mode Exit fullscreen mode

🔥 What's in this release?

✅ Signal Forms are now stable

  • Introduced as experimental in v21, Signal Forms are now production ready
  • The form model is just a signal
  • The directive is FormField, bound with [formField]
import { Component, signal } from '@angular/core';
import { form, FormField, required, minLength } from '@angular/forms/signals';

@Component({
  selector: 'app-register',
  imports: [FormField],
  template: `
    <input [formField]="userForm.login" />

    @if (userForm.login().getError('minLength'); as error) {
      <p class="error">{{ error.message }}</p>
    }

    <button [disabled]="userForm().invalid()">Register</button>
  `
})
export class RegisterComponent {
  user = signal({ login: '', password: '' });

  userForm = form(this.user, (form) => {
    required(form.login);
    minLength(form.login, 3, { message: 'At least 3 characters' });
    required(form.password);
  });
}
Enter fullscreen mode Exit fullscreen mode

New goodies

👉 Date validators

minDate(form.birthDate, new Date('1900-01-01'));
maxDate(form.birthDate, new Date());
Enter fullscreen mode Exit fullscreen mode

👉 Debounce validation

debounce(form.password, 'blur');
Enter fullscreen mode Exit fullscreen mode

👉 Conditional rules with when

disabled(form.age, { when: ({ valueOf }) => valueOf(form.isAdmin) });
Enter fullscreen mode Exit fullscreen mode

✅ resource, rxResource & httpResource are now stable

  • Async data the Signals way, now ready for production
import { httpResource } from '@angular/common/http';

userId = signal(1);

user = httpResource(() => `/api/users/${this.userId()}`);
Enter fullscreen mode Exit fullscreen mode
@if (user.isLoading()) {
  <p>Loading...</p>
} @else if (user.hasValue()) {
  <p>{{ user.value().name }}</p>
}
Enter fullscreen mode Exit fullscreen mode

✅ Angular Aria is now stable

  • The headless, accessible components from v21 are out of developer preview
  • Accordion, Combobox, Grid, Listbox, Menu, Tabs, Toolbar, Tree and more
  • Works with Signal Forms
npm i @angular/aria
Enter fullscreen mode Exit fullscreen mode

✅ OnPush is the default

  • Components without a changeDetection now use OnPush
  • ChangeDetectionStrategy.Default is renamed to ChangeDetectionStrategy.Eager
  • ng update adds Eager to existing components so nothing breaks
import { Component, ChangeDetectionStrategy } from '@angular/core';

@Component({
  selector: 'app-legacy',
  template: `...`,
  // 👉 opt out and keep the old behaviour
  changeDetection: ChangeDetectionStrategy.Eager
})
export class LegacyComponent {}
Enter fullscreen mode Exit fullscreen mode

✅ HttpClient uses Fetch by default

  • withFetch() is now the default, so the option is deprecated
  • Need the old XHR behaviour? Use withXhr()
provideHttpClient(withXhr()); // keep XMLHttpRequest
Enter fullscreen mode Exit fullscreen mode

👉 reportProgress is deprecated in favour of reportUploadProgress and reportDownloadProgress

✅ New @Service() decorator

👉 A shorter replacement for @Injectable({ providedIn: 'root' })

// Before
@Injectable({ providedIn: 'root' })
export class UserService {}

// After
@Service()
export class UserService {
  private http = inject(HttpClient); // use inject(), not constructor injection
}
Enter fullscreen mode Exit fullscreen mode
  • ng generate service now uses @Service()
  • Use --injectable if you still want @Injectable()

✅ injectAsync()

👉 Lazy load a service only when you actually need it

export class DashboardComponent {
  private readonly reportService = injectAsync(
    () => import('./report.service').then(m => m.ReportService)
  );

  async exportReport() {
    const service = await this.reportService();
    service.export();
  }
}
Enter fullscreen mode Exit fullscreen mode

✅ Template syntax improvements

Spread operator

@let moreNumbers = [...numbers, 4, 5, 6];
@let adminUser = { ...user, role: 'admin' };
Enter fullscreen mode Exit fullscreen mode

Arrow functions

<button (click)="counter.update((value) => value - 1)">-1</button>
Enter fullscreen mode Exit fullscreen mode

instanceof

@if (pet instanceof Dog) {
  <dog-card [dog]="pet" />
}
Enter fullscreen mode Exit fullscreen mode

Multiple @case matching

👉 Empty cases fall through, just like JavaScript

@switch (status()) {
  @case ('pending')
  @case ('processing') {
    <p>⏳ In progress</p>
  }
  @case ('done') {
    <p>✅ Done</p>
  }
}
Enter fullscreen mode Exit fullscreen mode

Comments inside tags

<div /* temporary wrapper */ class="card"></div>
Enter fullscreen mode Exit fullscreen mode

✅ AI-friendly Angular

Angular Agent Skills

👉 Teach your AI assistant Angular best practices

npx skills add https://github.com/angular/skills
Enter fullscreen mode Exit fullscreen mode

WebMCP (Experimental)

👉 Expose your app's actions and forms as tools for AI agents in the browser

provideExperimentalWebMcpTool([
  declareExperimentalWebMcpTool({
    name: 'list_users',
    description: 'Lists all users',
    inputSchema: { /* ... */ },
    execute: () => this.userService.list()
  })
]);
Enter fullscreen mode Exit fullscreen mode

✅ Other notable changes

  • strictTemplates is on by default
  • Incremental hydration is the default for SSR (withIncrementalHydration() is deprecated)
  • @defer (on idle(500ms)) supports a timeout
  • TypeScript 6 is required, Node 20 is dropped

For more, let us hear it from the creators Credits : Official Announcement 😄

Changelog: Repository

Top comments (0)