MCPcopy Create free account
hub / github.com/angular/components / asyncValidator

Function asyncValidator

src/material/stepper/stepper.spec.ts:1812–1821  ·  view source on GitHub ↗
(minLength: number, validationTrigger: Subject<void>)

Source from the content-addressed store, hash-verified

1810}
1811
1812function asyncValidator(minLength: number, validationTrigger: Subject<void>): AsyncValidatorFn {
1813 return (control: AbstractControl): Observable<ValidationErrors | null> => {
1814 return validationTrigger.pipe(
1815 map(() =>
1816 control.value && control.value.length >= minLength ? null : {asyncValidation: {}},
1817 ),
1818 take(1),
1819 );
1820 };
1821}
1822
1823function createComponent<T>(
1824 component: Type<T>,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected