Untitled

Anonymous
typescript
12/09/2022 11:21 AM
360 B
15
Indexable
  userExistsValidator(usersService: UsersService): AsyncValidatorFn  {
    return (control: AbstractControl) => {
      return usersService.findUserByEmail(control.value)
        .pipe(
            map(user => user ? {userExists:true} : null)
        );
    }
  }
Editor is loading...