(expected: string, timeouts = {})
| 38 | * that value |
| 39 | */ |
| 40 | export 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. |
no test coverage detected
searching dependent graphs…