ИЗ
Size: a a a
ИЗ
AS
ON
ON
ON
R
S
DT
R
R
this.FormService.personalFormGroup.controls.surname.markAsTouched();вот так сработало
this.FormService.personalFormGroup.controls.surname.markAsDirty();
this.FormService.personalFormGroup.controls.surname.updateValueAndValidity();
DT
updateValueAndValidityRecursively(
control: AbstractControl,
opts: { emitEvent?: boolean } = { emitEvent: true },
): void {
let forEachFn: ForEachFunction = null;
if (control instanceof FormArray) {
forEachFn = forEachFormArrayChild;
} else if (control instanceof FormGroup) {
forEachFn = forEachFormGroupChild;
}
if (forEachFn !== null) {
forEachFn.call(control, (ctrl: AbstractControl) => updateValueAndValidityRecursively(ctrl, opts));
}
control.updateValueAndValidity({ onlySelf: true, emitEvent: opts.emitEvent });
}
DT
updateValueAndValidityRecursively(
control: AbstractControl,
opts: { emitEvent?: boolean } = { emitEvent: true },
): void {
let forEachFn: ForEachFunction = null;
if (control instanceof FormArray) {
forEachFn = forEachFormArrayChild;
} else if (control instanceof FormGroup) {
forEachFn = forEachFormGroupChild;
}
if (forEachFn !== null) {
forEachFn.call(control, (ctrl: AbstractControl) => updateValueAndValidityRecursively(ctrl, opts));
}
control.updateValueAndValidity({ onlySelf: true, emitEvent: opts.emitEvent });
}
this.fg.markAllAsTouched();
updateValueAndValidityRecursively(this.fg);
R
DT
type ForEachFunction = (cb: (v: any, k: string | number) => void) => void;
function forEachFormGroupChild(this: FormGroup, cb: (v: any, k: string) => void): void {
Object.keys(this.controls).forEach(k => cb(this.controls[k], k));
}
function forEachFormArrayChild(this: FormArray, cb: (v: any, k: number) => void): void {
this.controls.forEach((control: AbstractControl, index: number) => {
cb(control, index);
});
}
DT
dangerousUpdateValueAndValidityRecursively(
control: AbstractControl,
opts: { emitEvent?: boolean } = { emitEvent: true },
): void {
(control as any)._updateTreeValidity(opts);
}
ON
DT

ON
ON
ON