Forms, routing and HTTP · mid
Signal forms
Signal forms (stable in v22) build a form from a signal model and a schema of validation rules.
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceThe notes
What you must know
- You own the data:
model = signal<Signup>({ email: "", password: "" }). - Create the form from it:
signupForm = form(this.model, (p) => { required(p.email); email(p.email); minLength(p.password, 8); }). - In the template, bind a field with
<input [formField]="signupForm.email" />, with theFormFielddirective imported. - Each field is callable and exposes signals for value, errors and state (touched, dirty, valid).
- Signal forms became stable in v22 (facts.md). Reactive forms still exist and appear in many apps.
- A signal form works with
computedand@ifnaturally, with novalueChangessubscription. - In an interview, say when you would still choose reactive forms: an existing app, or a library that needs
ControlValueAccessor.
The red pen
Common traps: mistake → fix
Mistake: Signal forms replace reactive forms everywhere now
Fix: both exist; old code keeps reactive forms.
Mistake: Signal forms need RxJS
Fix: state is in signals.
Easy to hard
Questions interviewers ask, easy to hard
- What is a signal form and how is it created?
- How do you add a rule such as minimum length?
- Reactive forms or signal forms for a new screen in v22?
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceYour first interview is free
Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.