Article Angular

Article

Angular 21 Signal Forms: A Practical Guide for Reactive Forms Developers

A hands-on guide to Angular Signal Forms for reactive-forms developers: models, fields, validation, submission, cross-field rules, async work, and a measured migration path.

3 min read Angular

Reactive Forms taught Angular developers to make form state explicit: create a FormGroup, attach validators, bind controls, subscribe when necessary. Signal Forms preserve that discipline but move the source of truth to a writable signal and derive the form structure from its shape.

Angular 21 introduced Signal Forms as an experimental API. The API became stable in Angular 22, so this is a practical guide to the approach introduced in v21 using the current stable documentation. That distinction matters for teams maintaining a strict v21 application: pin the exact API version and treat experimental APIs with the usual upgrade care.

The change in mental model

Here is a familiar Reactive Forms login form:

import {FormControl, FormGroup, ReactiveFormsModule, Validators} from '@angular/forms';

loginForm = new FormGroup({
  email: new FormControl('', {
    nonNullable: true,
    validators: [Validators.required, Validators.email],
  }),
  password: new FormControl('', {
    nonNullable: true,
    validators: [Validators.required, Validators.minLength(12)],
  }),
});

The FormGroup owns the current values and state. With Signal Forms, your application model owns values and the form is a typed field tree layered over it:

import {signal} from '@angular/core';
import {email, form, minLength, required} from '@angular/forms/signals';

readonly loginModel = signal({
  email: '',
  password: '',
});

readonly loginForm = form(this.loginModel, (path) => {
  required(path.email, {message: 'Email is required'});
  email(path.email, {message: 'Enter a valid email address'});
  required(path.password, {message: 'Password is required'});
  minLength(path.password, 12, {message: 'Use at least 12 characters'});
});

loginModel() is the submitted domain-shaped data. loginForm mirrors that data and provides field state, validation, and UI bindings. This removes the recurring getRawValue() / DTO synchronization question: there is one application model from the beginning.

Binding controls and showing state

Import FormField into the standalone component and bind a field tree path—not a FormControl—to the control.

import {FormField} from '@angular/forms/signals';

@Component({
  imports: [FormField],
  templateUrl: './login.html',
})
export class LoginComponent {
  // model and form above
}
<label>
  Email
  <input type="email" [formField]="loginForm.email" />
</label>

@if (loginForm.email().touched() && loginForm.email().invalid()) {
  <p class="error" role="alert">{{ loginForm.email().errors()[0].message }}</p>
}

There is a small syntax adjustment worth learning: loginForm.email is a field-tree node; loginForm.email() returns its FieldState; loginForm.email().value() reads its value. That field state exposes reactive valid(), invalid(), errors(), touched(), dirty(), pending(), disabled(), hidden(), and readonly() signals.

For simple programmatic changes, update the model or the field’s writable value:

this.loginModel.update((value) => ({...value, email: 'ada@example.com'}));
// Or, for a focused field update:
this.loginForm.email().value.set('ada@example.com');

Both keep the UI and model synchronized. Prefer a model update when the change is business-state oriented or affects several fields.

Schema validation, not control construction

Signal Forms centralize rules in the form() schema function. The first parameter is a path tree, not the current values. A validator reads its own current value through the context passed to the callback:

import {form, required, validate} from '@angular/forms/signals';

readonly passwordForm = form(this.passwordModel, (path) => {
  required(path.newPassword);

  validate(path.confirmPassword, ({value, valueOf}) => {
    return value() === valueOf(path.newPassword)
      ? undefined
      : {kind: 'mismatch', message: 'Passwords must match'};
  });
});

valueOf() is the key cross-field tool. It reads another path without reaching into the component or adding a hand-managed subscription. For conditional behavior, use a schema rule such as applyWhen() rather than hiding a control in the template and hoping that also changes validation semantics.

Model shape also matters. Use plain objects and arrays in the structural layer. Class instances, Map, and Set are not supported as form structure, even when TypeScript permits them.

Submission without a hand-built ceremony

Reactive Forms developers often write a submit handler that calls markAllAsTouched(), checks invalid, guards duplicate requests, and maps server errors. Signal Forms offer FormRoot and a submission action to coordinate that lifecycle.

import {FormField, FormRoot, form, required} from '@angular/forms/signals';

readonly contactModel = signal({name: '', email: ''});

readonly contactForm = form(
  this.contactModel,
  (path) => {
    required(path.name);
    required(path.email);
  },
  {
    submission: {
      action: async (field) => {
        const result = await this.contacts.save(field().value());

        if (result.ok) return;

        return {
          kind: 'serverError',
          message: result.message,
          fieldTree: field.email,
        };
      },
      onInvalid: (field) => {
        field().errorSummary()[0]?.fieldTree().focusBoundControl();
      },
    },
  },
);
<form [formRoot]="contactForm">
  <label>Name <input [formField]="contactForm.name" /></label>
  <label>Email <input type="email" [formField]="contactForm.email" /></label>

  <button type="submit" [disabled]="contactForm().submitting()">
    @if (contactForm().submitting()) { Sending… } @else { Send }
  </button>
</form>

FormRoot prevents the browser’s default submit, sets novalidate, and triggers the form submission workflow. The workflow marks interactive fields touched, stops on validation errors, tracks submitting(), and lets the action return errors targeted at a field. That is a meaningful ergonomic improvement, but keep server-side validation authoritative.

Async validation and dynamic fields

Use validateHttp() for the usual HTTP-backed checks such as username availability; it handles the common request-and-response case with little ceremony. validateAsync() is the lower-level alternative when the work is not HTTP or needs custom resource behavior. Both are intentionally separate from synchronous validate(), map success and failure to form errors, and wait for synchronous rules to pass first. Design the endpoint so it can tolerate repeated and cancelled checks, then debounce the validator when the interaction calls for it.

Arrays are part of the model, not a separate FormArray type. A field tree mirrors them, so dynamic rows are rendered from the field-tree collection and model changes happen by immutably updating the signal:

import {applyEach, form, required} from '@angular/forms/signals';

readonly teamModel = signal({members: [] as Array<{name: string}>});
readonly teamForm = form(this.teamModel, (path) => {
  applyEach(path.members, (member) => required(member.name));
});

addMember() {
  this.teamModel.update((team) => ({
    ...team,
    members: [...team.members, {name: ''}],
  }));
}
@for (member of teamForm.members; track member) {
  <input [formField]="member.name" aria-label="Member name" />
}

Track the field rather than the index. Array items receive tracking identities, so track member keeps each input bound to its own row when a row is removed or reordered; track $index reassigns rows to different fields and produces stale state.

That is usually easier to reason about than a parallel FormArray mutation. For truly server-defined forms, the API also supports schema composition and custom controls; these are good reasons to read the dedicated guide before committing to a generic form engine.

What should migrate, and when?

Do not convert working Reactive Forms just because a new API exists. Typed Reactive Forms remain stable, capable, and often the least risky option in a mature app. Signal Forms are especially appealing for new, signal-first features where the form model is naturally application state and schema-based validation will stay readable.

Start with one bounded form. Establish conventions for model types, error presentation, asynchronous checks, and test helpers. Then decide from evidence whether the model-first approach improves your team’s forms. Angular’s Signal Forms overview, form-model guide, field-state guide, and comparison with Reactive Forms provide the API detail behind the patterns above.

Related articles

Keep reading

Search

Search the publication

Search articles and topic pages without leaving the page.