-
Notifications
You must be signed in to change notification settings - Fork 31
Open
Labels
effort-1: minutesWill only take a few minutes to fix/createWill only take a few minutes to fix/createscope: libAnything related to the library itselfAnything related to the library itselftype: bug/fixThis is a bug or at least needs a fixThis is a bug or at least needs a fixworkaround: noneNo workaroundNo workaround
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
alex87 and maxime1992
Metadata
Metadata
Assignees
Labels
effort-1: minutesWill only take a few minutes to fix/createWill only take a few minutes to fix/createscope: libAnything related to the library itselfAnything related to the library itselftype: bug/fixThis is a bug or at least needs a fixThis is a bug or at least needs a fixworkaround: noneNo workaroundNo workaround