I've got a formgroup to which I'm programmatically adding/removing controls through addControl/removeControl.
A basic addControl call looks like this:
formGroup.addControl(
field.name,
new FormControl(null, {
validators: field.required ? [Validators.required] : null
})
There are scenarios in which I'll have to remove a field and then re-add the exact same control under the same name.
This doesn't appear to remove the old validation or add the new validations causing old errors to remain and re-triggers of validation freaking out because the old reference no longer exists.
Recreating the formgroup from scratch is not really an option since I need the original reference so I can subscribe to its valuechanges stream.