Untitled
unknown
typescript
3 years ago
270 B
4
Indexable
userExistsValidator(usersService: UsersService): AsyncValidatorFn {
return (control: AbstractControl) => {
return usersService.findUserByEmail(control.value)
.pipe(
map(user => user ? {userExists:true} : null)
);
}
}Editor is loading...