Sub topic 1
Why Signal Forms and how it differs from Reactive Forms
Prerequisites
This chapter assumes you know:
- TypeScript fundamentals.
- Angular standalone components and templates.
- Angular signals:
signal(),computed(), andeffect(). - Basic HTML form elements and validation concepts.
Experience with Reactive Forms or Template-driven forms helps, but you don't need it.
What Signal Forms is
Signal Forms is Angular's signal-based forms API. You import it from @angular/forms/signals. It was introduced as experimental in Angular 21, so names and details can change between releases. The [field] directive and the Field class used in this tutorial are the Angular 21 names, and later versions may rename them.
The core idea is that your data lives in a writable signal, called the model. You pass the model to form(), and Angular builds a tree of fields from its shape. Each field exposes its value, validity, and interaction state as signals.
import { signal } from '@angular/core';
import { form, required } from '@angular/forms/signals';
const model = signal({ name: '' });
const profileForm = form(model, (path) => {
required(path.name, { message: 'Name is required' });
});
console.log(profileForm.name().value());
console.log(profileForm.name().valid());The second argument to form() is a schema function. It declares the rules for the form in one place. Later chapters cover it in detail.
How it differs from Reactive Forms
Reactive Forms builds a separate object tree of FormControl and FormGroup instances. Those objects hold the values, and you read them through value, valueChanges, and statusChanges, which are mostly RxJS observables. The data is copied into the form objects, and you keep it in sync with your own state.
Signal Forms inverts this. The signal model is the single source of truth. Writing to a field updates the model, and updating the model updates the fields.
| Aspect | Template-driven forms | Reactive Forms | Signal Forms |
|---|---|---|---|
| Source of truth | Component properties with `ngModel` | `FormControl` and `FormGroup` objects | A writable signal model |
| Reacting to changes | Directive events | Observables such as `valueChanges` | Signals read in templates, `computed()`, and `effect()` |
| Validation | Directives in the template | Validator functions on each control | A schema function passed to `form()` |
| Template binding | `ngModel` | `formControlName` or `[formControl]` | `[field]` |
How the pieces connect
Because field state is made of signals, a template that reads loginForm.email().invalid() updates automatically when the value changes. You don't subscribe, and you don't unsubscribe.
When to choose it
Signal Forms fits well when:
- Your component state already uses signals.
- You want one typed model that matches the shape of your data.
- You want validation, disabled state, and similar rules declared together instead of scattered across controls.
Stay with Reactive Forms when your app depends on features the experimental API doesn't yet cover, or when you have a large working codebase and no reason to move. The two can coexist, and a later chapter covers incremental migration.
Common mistakes
- Treating the form as a copy of the data. The model is the data, so read
this.model()for the current values. - Replacing the model signal with a new
signal()after creating the form. Update the existing signal withset()orupdate()instead. - Mixing
[field]withformControlNameon the same input. Use one forms system per control.
Exercise
In Reactive Forms the control objects hold the data. In Signal Forms, what holds it, and what happens to the form fields when you call set() on that holder?
Show answer
A writable signal model holds the data. Calling set() on it changes the value, and the form's field state signals update to match, because the fields are derived from the model.