feat(forms): add markAllAsTouched() to AbstractControl (#26812)

Add functionality to mark a control and its descendant controls as touched

Closes #19400

PR Close #26812
This commit is contained in:
alsami
2018-10-29 09:36:17 +01:00
committed by Alex Rickabaugh
parent ab2bf83398
commit 45bf911df8
5 changed files with 133 additions and 0 deletions

View File

@ -364,6 +364,16 @@ export abstract class AbstractControl {
}
}
/**
* Marks the control and all its descendant controls as `touched`.
* @see `markAsTouched()`
*/
markAllAsTouched(): void {
this.markAsTouched({onlySelf: true});
this._forEachChild((control: AbstractControl) => control.markAllAsTouched());
}
/**
* Marks the control as `untouched`.
*