MCPcopy Index your code
hub / github.com/angular/angular / markAsPristine

Function markAsPristine

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

Source from the content-addressed store, hash-verified

1178 sourceControl?: AbstractControl;
1179 }): void;
1180 markAsPristine(
1181 opts: {onlySelf?: boolean; emitEvent?: boolean; sourceControl?: AbstractControl} = {},
1182 ): void {
1183 const changed = this.pristine === false;
1184 this.pristine = true;
1185 this._pendingDirty = false;
1186
1187 const sourceControl = opts.sourceControl ?? this;
1188 this._forEachChild((control: AbstractControl) => {
1189 /** We don't propagate the source control downwards */
1190 control.markAsPristine({onlySelf: true, emitEvent: opts.emitEvent});
1191 });
1192
1193 if (!opts.onlySelf) {
1194 this._parent?._updatePristine(opts, sourceControl);
1195 }
1196
1197 if (changed && opts.emitEvent !== false) {
1198 this._events.next(new PristineChangeEvent(true, sourceControl));
1199 }
1200 }
1201
1202 /**
1203 * Marks the control as `pending`.

Callers

nothing calls this directly

Calls 3

_forEachChildMethod · 0.65
markAsPristineMethod · 0.45
nextMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…