MCPcopy Create free account
hub / github.com/angular/angular / markAsUntouched

Function markAsUntouched

packages/forms/src/model/abstract_model.ts:1107–1126  ·  view source on GitHub ↗
(
    opts: {onlySelf?: boolean; emitEvent?: boolean; sourceControl?: AbstractControl} = {},
  )

Source from the content-addressed store, hash-verified

1105 sourceControl?: AbstractControl;
1106 }): void;
1107 markAsUntouched(
1108 opts: {onlySelf?: boolean; emitEvent?: boolean; sourceControl?: AbstractControl} = {},
1109 ): void {
1110 const changed = this.touched === true;
1111 this.touched = false;
1112 this._pendingTouched = false;
1113
1114 const sourceControl = opts.sourceControl ?? this;
1115 this._forEachChild((control: AbstractControl) => {
1116 control.markAsUntouched({onlySelf: true, emitEvent: opts.emitEvent, sourceControl});
1117 });
1118
1119 if (!opts.onlySelf) {
1120 this._parent?._updateTouched(opts, sourceControl);
1121 }
1122
1123 if (changed && opts.emitEvent !== false) {
1124 this._events.next(new TouchedChangeEvent(false, sourceControl));
1125 }
1126 }
1127
1128 /**
1129 * Marks the control as `dirty`. A control becomes dirty when

Callers

nothing calls this directly

Calls 3

_forEachChildMethod · 0.65
markAsUntouchedMethod · 0.45
nextMethod · 0.45

Tested by

no test coverage detected