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

Function shouldRunAction

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

Source from the content-addressed store, hash-verified

511}
512
513function shouldRunAction(
514 node: FieldNode,
515 ignoreValidators?: FormSubmitOptions<unknown, unknown>['ignoreValidators'],
516) {
517 switch (ignoreValidators) {
518 case 'all':
519 return true;
520 case 'none':
521 return untracked(node.valid);
522 default: // Ignore pending validators by default (or specified 'pending').
523 return !untracked(node.invalid);
524 }
525}
526
527/**
528 * 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