I have seen a lot of Angular and Angular JS code which tries to handle everything about forms itself, such as the validity checking, value updating and value patching. Luckily the reactive forms module handles all of this for us.

However one thing that has always slightly annoyed me is that the FormBuilder (as far as i’m aware) doesn’t allow passing of a type attribute, so we can’t tell it about our nifty form model. The annoying thing about this is that if our model changes we aren’t told by the compiler to update our reactive form definition. And so with a little typescripty-goodness we can have this extended type safety, see the example component below.

So far this pattern has been working quite well.