Typed forms are a clear improvement and the migration produces some genuinely confusing errors, most of which come from two misunderstandings.
Disabled controls and getRawValue
value excludes disabled controls, so its type is a partial. If you need everything, getRawValue() is what you want, and it is typed correctly. A great deal of the frustration people report is this one distinction, and the type system is being accurate rather than difficult.
Nullability is real
A control is nullable by default because reset() sets it to null. Use nonNullable: true when a reset should return to the initial value instead, which is usually what a form actually wants.
- Build forms with
FormBuilder.nonNullableto avoid repeating it on every control. - Define the form interface first and derive the group from it, rather than inferring the shape from a builder call and hoping.
- For dynamic forms,
FormRecordexists precisely because aFormGroupwith unknown keys cannot be typed.
Tags:
1 Comments
Leave a comment
Sign in to leave a comment.
Signing in is unavailable right now.







Lotte Jansen
March 11, 2025The value versus getRawValue distinction explains about 80% of the complaints I have seen about typed forms.