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

Method markAsTouchedInternal

packages/forms/signals/src/field/node.ts:281–302  ·  view source on GitHub ↗
(options?: MarkAsTouchedOptions)

Source from the content-addressed store, hash-verified

279 }
280
281 markAsTouchedInternal(options?: MarkAsTouchedOptions): void {
282 if (this.structure.isOrphaned()) {
283 return;
284 }
285 const skipValidation = this.validationState.shouldSkipValidation();
286 if (!skipValidation) {
287 this.nodeState.markAsTouched();
288 }
289 // Flush even when validation is skipped: the debounce writes the value anyway, and flushing
290 // makes it land before a submit action reads the model.
291 this.flushSync();
292 if (options?.skipDescendants) {
293 return;
294 }
295 // Inactive subtrees stay lazy: only fields that already exist can have a pending value.
296 const children = skipValidation
297 ? this.structure.materializedChildren()
298 : this.structure.children();
299 for (const child of children) {
300 child.markAsTouchedInternal();
301 }
302 }
303
304 /**
305 * Marks this specific field as dirty.

Callers 1

markAsTouchedMethod · 0.95

Calls 3

flushSyncMethod · 0.95
markAsTouchedMethod · 0.65
childrenMethod · 0.45

Tested by

no test coverage detected