FORM SERVICE CHANGE > mark arrays as touched if no array items

This commit is contained in:
mchouliara 2024-09-06 12:59:29 +03:00
parent 8f455a5324
commit 2d1ba944ee
1 changed files with 3 additions and 0 deletions

View File

@ -32,6 +32,9 @@ export class FormService {
this.touchAllFormFields(control);
});
} else if (formControl instanceof UntypedFormArray) {
if(!formControl.controls?.length){
formControl.markAsTouched()
}
formControl.controls.forEach(item => {
this.touchAllFormFields(item);
});