Open
Description
Hi!, firstly thank you for making angular forms better.
I think I found a bug, please look at this stackblitz:
https://stackblitz.com/edit/ngx-subform-array-validation
specifically at the child-form.component, I´m using a validation function to validate FormArray length.
protected getFormControls(): Controls<ChildForm> {
return {
values: new FormArray([], this.minLengthArray(3)),
};
}
minLengthArray(min: number) {
return (c: AbstractControl): { [key: string]: any } => {
if (c.value.length >= min)
return null;
return { 'minLengthArray': true };
}
}
When I delete an ítem from the array, the root form and subform should be in an invalid state, but the validation error is not propagating to the parent, only the subform is invalid