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

Function asyncValidator

packages/forms/test/util.ts:40–46  ·  view source on GitHub ↗
(expected: string, timeouts = {})

Source from the content-addressed store, hash-verified

38 * that value
39 */
40export function asyncValidator(expected: string, timeouts = {}): AsyncValidatorFn {
41 return (control: AbstractControl) => {
42 const timeout = (timeouts as any)[control.value] ?? 0;
43 const result = control.value != expected ? {async: true} : null;
44 return createValidationPromise(result, timeout);
45 };
46}
47
48/**
49 * Returns an async validator that emits null or a custom error after a specified delay.

Callers 4

form_group_spec.tsFile · 0.90
directives_spec.tsFile · 0.90
form_array_spec.tsFile · 0.90

Calls 1

createValidationPromiseFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…