Frontend
Stop fighting FormGroup: Angular 22 Signal Forms in depth
FrontendNov 28, 2026

Stop fighting FormGroup: Angular 22 Signal Forms in depth

Learn how Angular 22 Signal Forms replace FormGroup boilerplate with signal-backed models, typed schemas, cross-field validation, async HTTP checks, and gradual migration.

Reading: 14 min

Take a look at any large Angular codebase and you will quickly find where things get ugly: the forms. You have likely seen it firsthand: a FormGroup built in the constructor, three valueChanges.subscribe() calls desperately trying to keep fields in sync, a custom validator nobody dares to touch, and a template choked with form.get('address.zip')?.errors?.['pattern'].

Angular 22 gives us a way out. Signal Forms, which lived in @angular/forms/signals as an experimental API in v21, are now stable and ready for production. In this article I'll walk you through them the way I'd teach a new teammate: first the mental model, then one feature at a time, and at the end how to migrate an app that already has a pile of Reactive Forms.

The mental model: your data is the form#

With Reactive Forms, the form is the source of truth. You build a tree of FormControl instances, and your data lives inside it. Getting it out means calling .value or .getRawValue().

Signal Forms flip that. You start with a plain signal holding your data model. Then you hand it to form(), which builds a field tree on top of it. When the user types, the signal updates. When you set the signal, the inputs update. Your data never leaves your model.

Three pieces, that's all:

  1. A model signal with your data.

  2. The form() function, which receives the model and a schema function with your rules.

  3. The [formField] directive, which binds an input to a field.

The Angular docs are honest about where this fits: Signal Forms work best in new signal-based apps, and Reactive Forms are still a solid choice for existing ones. Keep that in mind when we get to migration.

Your first form#

Here's a sign-up form. Read it once top to bottom, and then we'll take it apart.

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

interface SignupData {
  name: string;
  email: string;
  password: string;
}

@Component({
  selector: 'app-signup',
  imports: [FormField, FormRoot],
  template: `
    <form [formRoot]="signupForm">
      <label>
        Name
        <input [formField]="signupForm.name" />
      </label>

      <label>
        Email
        <input type="email" [formField]="signupForm.email" />
      </label>
      @if (signupForm.email().touched() && signupForm.email().invalid()) {
        <p class="error">{{ signupForm.email().errors()[0].message }}</p>
      }

      <label>
        Password
        <input type="password" [formField]="signupForm.password" />
      </label>

      <button type="submit" [disabled]="signupForm().submitting()">Create account</button>
    </form>
  `,
})
export class Signup {
  private readonly model = signal<SignupData>({ name: '', email: '', password: '' });

  readonly signupForm = form(
    this.model,
    (s) => {
      required(s.name, { message: 'Name is required' });
      required(s.email, { message: 'Email is required' });
      email(s.email, { message: 'Enter a valid email address' });
      minLength(s.password, 8, { message: 'Use at least 8 characters' });
    },
    {
      submission: {
        action: async (field) => {
          console.log('Sending', field().value());
        },
      },
    },
  );
}

A few things to notice:

  • The model is a normal signal with a normal interface. No FormControl<string | null>, no nonNullable: true.

  • signupForm.email is typed from the model. Misspell it as signupForm.emial and the compiler stops you.

  • The rules live in one place, the schema function. The s parameter is a path into your model, so s.email points at the email field.

  • [formRoot] on the <form> element handles the boring parts. It sets novalidate, prevents the page reload on submit, and calls the submission action you configured.

Field state: everything is a signal#

Every field is a function. Call it and you get its state, and every piece of that state is a signal:

Signal

What it tells you

value()

The current value. It's writable.

valid()

Passes every rule and has no async validation pending.

invalid()

Has at least one validation error.

errors()

The list of error objects.

pending()

Async validation is running.

touched()

The user focused and left the field, or code marked it as touched.

dirty()

The user changed the value, even if they changed it back.

disabled()

Doesn't accept input and doesn't count toward the parent's state.

readonly()

Shows the value but can't be edited, and doesn't count toward the parent's state.

hidden()

The field should be hidden. You decide how to hide it.

The root form is also a field, so signupForm().valid(), signupForm().dirty() and signupForm().pending() work the same way for the whole form.

The pattern you'll write most often is "show errors only after the user has left the field":

html
@if (signupForm.email().touched() && signupForm.email().invalid()) {
  <ul class="error-list">
    @for (error of signupForm.email().errors(); track error) {
      <li>{{ error.message }}</li>
    }
  </ul>
}

Since everything is a signal, this plays perfectly with OnPush, which is the default in Angular 22. No markForCheck(), no async pipe.

Validation#

Built-in validators#

All built-in validators take the path first and an optional object with a message:

typescript
required(s.email, { message: 'Email is required' });
email(s.email, { message: 'Enter a valid email address' });
min(s.age, 18, { message: 'You must be at least 18' });
max(s.age, 120, { message: 'Please enter a valid age' });
minLength(s.password, 8, { message: 'Use at least 8 characters' });
maxLength(s.bio, 500, { message: 'Keep it under 500 characters' });
pattern(s.postalCode, /^\d{5}$/, { message: 'Postal code must be 5 digits' });

Angular 22 added two more for dates, minDate() and maxDate():

typescript
minDate(s.birthDate, new Date('1900-01-01'));

Conditional rules with when#

A rule that only applies sometimes takes a when option. Inside it, valueOf() reads any other field in the form:

typescript
required(s.promoCode, {
  message: 'Promo code is required for discounts',
  when: ({ valueOf }) => valueOf(s.applyDiscount),
});

Because valueOf() reads a signal, the rule re-runs by itself when applyDiscount changes. You don't wire anything.

Your own validators#

For anything the built-ins don't cover, use validate(). It returns an error object with a kind and a message, or null when the value is fine:

typescript
validate(s.website, ({ value }) => {
  if (!value().startsWith('https://')) {
    return { kind: 'https', message: 'URL must start with https://' };
  }
  return null;
});

The kind is the error's identity. Your template can check it, and your tests can assert on it. The message is what the user reads.

Cross-field validation#

This used to mean a validator on the whole FormGroup plus some juggling to show the error on the right field. Now it's the same validate() with valueOf():

typescript
validate(s.confirmPassword, ({ value, valueOf }) =>
  value() === valueOf(s.password)
    ? null
    : { kind: 'mismatch', message: 'Passwords do not match' },
);

The error lives on confirmPassword, which is exactly where the user expects to see it.

Form logic: disabled, hidden, readonly#

Behavior rules live in the same schema function as validation, and they use the same when option:

typescript
disabled(s.couponCode, { when: ({ valueOf }) => valueOf(s.total) < 50 });
hidden(s.publicUrl, { when: ({ valueOf }) => !valueOf(s.isPublic) });
readonly(s.title, { when: ({ valueOf }) => valueOf(s.isLocked) });

Two details trip people up.

First, disabled, readonly and hidden fields skip validation. A hidden publicUrl that's empty won't block the form, which is usually what you want.

Second, hidden doesn't touch the DOM. There's no native hidden property for form controls, and [formField] doesn't add a hidden attribute. You hide it yourself:

html
@if (!profileForm.publicUrl().hidden()) {
  <input [formField]="profileForm.publicUrl" />
}

When several rules depend on the same condition, group them with applyWhen() instead of repeating the when:

typescript
applyWhen(
  s,
  ({ valueOf }) => valueOf(s.country) === 'US',
  (s) => {
    required(s.zipCode);
    pattern(s.zipCode, /^\d{5}(-\d{4})?$/);
  },
);

Debouncing#

A search box shouldn't update the model on every keystroke. debounce() delays the sync:

typescript
debounce(s.query, 300);

Angular 22 also lets you wait until the user leaves the field:

typescript
debounce(s.password, 'blur');

When a field is marked as touched, the value syncs immediately and any pending debounce is dropped. So you never submit a stale value.

Reusing rules with schemas#

Once you have two forms with an address, you'll want to write the address rules once. schema() turns a rules function into a reusable, typed object:

typescript
import { schema, apply, applyEach, required, minLength, min } from '@angular/forms/signals';

interface Address {
  street: string;
  city: string;
  zipCode: string;
}

export const addressSchema = schema<Address>((address) => {
  required(address.street);
  required(address.city);
  minLength(address.zipCode, 5);
});

Then apply() attaches it to any field with that shape:

typescript
readonly checkoutForm = form(this.model, (s) => {
  apply(s.shippingAddress, addressSchema);
  apply(s.billingAddress, addressSchema);
});

The schema only sees the fields inside the address, so it can't accidentally depend on the rest of the form.

For arrays, applyEach() runs a schema on every item, including items added after the form was created:

typescript
interface OrderItem {
  sku: string;
  quantity: number;
}

const orderItemSchema = schema<OrderItem>((item) => {
  required(item.sku);
  min(item.quantity, 1);
});

readonly orderForm = form(this.model, (s) => {
  applyEach(s.items, orderItemSchema);
});

That's the replacement for FormArray. You push a new item into the model signal, and it gets validated. No this.items.push(this.fb.group(...)).

If you use a feature-sliced folder structure, schemas have a natural home: next to the domain model in features/<domain>/data/. The address schema can live in shared/ once two features need it.

Async validation#

"Is this email already registered?" is the classic async rule. For HTTP checks, use validateHttp():

typescript
validateHttp(s.email, {
  request: ({ value }) => (value() ? `/api/users/check-email?email=${value()}` : undefined),
  onSuccess: (response: { available: boolean }) =>
    response.available ? null : { kind: 'emailTaken', message: 'This email is already registered' },
  onError: () => ({ kind: 'serverError', message: 'Could not verify the email' }),
  debounce: 400,
});

Piece by piece:

  • request builds the URL. Returning undefined skips the check, which is how you avoid calling the API with an empty field.

  • onSuccess turns the response into an error or null.

  • onError handles network or HTTP failures.

  • debounce is new in Angular 22. It throttles only this validator. Before, you had to debounce the whole field, which also delayed synchronous rules like required.

While the request runs, the field's pending() is true. During that time valid() and invalid() are both false and errors() is empty. So show a loading state:

html
@if (signupForm.email().pending()) {
  <span class="loading">Checking availability...</span>
}

For checks that aren't HTTP, like a WebSocket, IndexedDB or a Web Worker, there's validateAsync(). It works with a resource through params, factory, onSuccess and onError. The docs recommend validateHttp() whenever it fits, and validateAsync() only when it can't.

Submission#

This is where I want you to slow down, because the defaults have a trap.

The submission option#

You already saw the basic shape. When the user submits, Signal Forms does the following in order. First, it marks every interactive field as touched, so errors that only show after touch become visible. Hidden, disabled and readonly fields are skipped. Then it decides whether to run your action, based on validation. If the form is invalid, it calls onInvalid instead, which is a good place to focus the first broken field.

The trap: pending validators don't block by default#

The ignoreValidators option controls that decision, and it accepts three values:

Value

Behavior

'pending' (default)

Submits if no validator has failed, even if async validators are still running.

'none'

Submits only when every validator has passed. Pending validators block.

'all'

Always submits, whatever the validation state.

Read the default again. If a user types an email and hits Enter before your validateHttp() answers, the action runs with an email that may already be taken. For forms with async checks, the docs suggest 'none':

typescript
submission: {
  ignoreValidators: 'none',
  action: async (field) => {
    // ...
  },
},

And 'all' makes sense for one thing: saving a draft, where you want to keep whatever the user typed even if it's incomplete. It's also good UX to disable the button while the form is pending:

html
<button type="submit" [disabled]="signupForm().pending()">Create account</button>

Server errors land on the right field#

The backend will always find something your validators didn't. Return it from the action, and Signal Forms shows it like any other error. By default it goes to the form itself. Add fieldTree to point it at a specific field:

typescript
action: async (field) => {
  const result = await this.api.signup(field().value());
  if (result.ok) return;

  return { kind: 'emailTaken', message: result.message, fieldTree: field.email };
},

Here I'm assuming an api service injected in the component. To report errors on several fields, return an array.

While the action runs, submitting() is true, which is what the button in the first example uses to avoid double submits.

Submitting by hand#

Not every save comes from a <form>. For a "Save" button in a toolbar, call submit() yourself:

typescript
async onSave() {
  const success = await submit(this.profileForm, async (field) => {
    // save field().value()
  });
}

Custom controls#

Sooner or later you'll build your own input: a star rating, a date picker, a tag selector. With Reactive Forms that meant ControlValueAccessor, registerOnChange, registerOnTouched and a provider nobody remembers how to write.

With Signal Forms, you implement FormValueControl and expose a value model:

typescript
import { Component, input, model, output } from '@angular/core';
import { FormValueControl } from '@angular/forms/signals';

@Component({
  selector: 'app-rating',
  template: `
    @for (star of [1, 2, 3, 4, 5]; track star) {
      <button
        type="button"
        [disabled]="disabled()"
        [attr.aria-label]="star + ' stars'"
        (click)="value.set(star); touch.emit()"
      >
        {{ star <= value() ? '★' : '☆' }}
      </button>
    }
  `,
})
export class Rating implements FormValueControl<number> {
  readonly value = model(0);
  readonly disabled = input(false);
  readonly touched = input(false);
  readonly touch = output<void>();
}

Then you use it exactly like a native input:

html
<app-rating [formField]="reviewForm.score" />

value is the only required member. disabled, touched and errors are optional inputs that [formField] fills in for you when you declare them. For checkboxes and toggles there's FormCheckboxControl, which uses a checked model instead of value.

One breaking change if you wrote custom controls in v21: the touched model was replaced by a touched input plus a touch output, like in the example. The release notes say you have to make that change by hand.

And a nice bonus: in Angular 22, a component built on FormValueControl also works with Reactive and template-driven forms, with formControlName or [(ngModel)], with no template changes. So your design system can ship one version of each control.

Migrating from Reactive Forms#

You don't need to rewrite every form this sprint. The docs offer two directions, and you can pick per form.

Top-down: keep old controls inside a new form#

If you want a new Signal Form but have a reactive FormControl you can't replace yet, put it inside the model and use compatForm():

typescript
const user = signal({
  email: '',
  password: passwordControl, // the existing reactive FormControl
});

const f = compatForm(user);

The old control shows up in the field tree like any other field, so f.password().valid() and [formField]="f.password" just work. One detail: errors from old validators come as CompatValidationError, which has no message. The original error object is in context.

Bottom-up: put a signal field inside an old FormGroup#

If the parent FormGroup has to stay, migrate the leaves with SignalFormControl. It exposes a signal-based field as a standard FormControl:

typescript
emailControl = new SignalFormControl('', (p) => {
  required(p, { message: 'Email is required' });
});

form = new FormGroup({
  email: this.emailControl,
});

Values sync both ways. In the template, bind it with [formField]="emailControl.fieldTree", not with formControlName.

A few reactive methods don't exist here. Calling disable() or enable() throws, so use the disabled rule. Adding or removing validators at runtime throws, so use applyWhen. setErrors() and markAsPending() aren't supported.

The CSS classes you'll miss#

Reactive Forms add ng-valid, ng-touched and friends to every control. Signal Forms don't. If your stylesheets depend on those classes, turn them back on in the app config:

typescript
provideSignalFormsConfig({ classes: NG_STATUS_CLASSES });

My suggestion for the order: new forms in Signal Forms from today, then the forms you touch for other reasons, and leave stable, untouched forms for last. A form that works and nobody changes doesn't owe you a migration.

Where forms fit in the architecture#

In a clean layered frontend architecture, the rule stays straightforward: the form lives in the page component, because it orchestrates. UI components only draw, and when they need to be form inputs, they implement FormValueControl. The submission.action calls the store, so the business rule for "create an order" exists in one place, whether the call comes from a form, a button or an AI agent through WebMCP.

The short version#

Your data lives in a signal, and the form is a view on top of it. Rules go in one schema function: validators, when conditions, disabled, hidden, readonly and debounce. Reuse them with schema(), apply() and applyEach(). Use validateHttp() with its own debounce for async checks, and set ignoreValidators: 'none' when those checks matter, because the default lets the form submit while they're still running. Return server errors with fieldTree so they land on the right field. Build custom inputs with FormValueControl. And migrate gradually, with compatForm() from the top or SignalFormControl from the bottom.

If you get stuck, ping me before you reach for valueChanges.subscribe().

Sources#

#Frontend#TypeScript#Frontend Architecture#Angular