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

Function shouldRunAction

packages/forms/signals/src/api/structure.ts:528–540  ·  view source on GitHub ↗
(
  node: FieldNode,
  ignoreValidators?: FormSubmitOptions<unknown, unknown>['ignoreValidators'],
)

Source from the content-addressed store, hash-verified

526}
527
528function shouldRunAction(
529 node: FieldNode,
530 ignoreValidators?: FormSubmitOptions<unknown, unknown>['ignoreValidators'],
531) {
532 switch (ignoreValidators) {
533 case 'all':
534 return true;
535 case 'none':
536 return untracked(node.valid);
537 default: // Ignore pending validators by default (or specified 'pending').
538 return !untracked(node.invalid);
539 }
540}
541
542/**
543 * Sets a list of submission errors to their individual fields.

Callers 1

submitFunction · 0.85

Calls 1

untrackedFunction · 0.90

Tested by

no test coverage detected