Skip to content

Instantly share code, notes, and snippets.

@nicobytes
Created September 23, 2019 14:58
Show Gist options
  • Save nicobytes/fee633fbe0285f4f0873ba37c0f563ce to your computer and use it in GitHub Desktop.
Save nicobytes/fee633fbe0285f4f0873ba37c0f563ce to your computer and use it in GitHub Desktop.
export class ValidateEmailNotTaken {
static createValidator(signupService: SignupService) {
return (control: AbstractControl) => {
return signupService.checkEmailNotTaken(control.value).map(res => {
return res ? null : { emailTaken: true };
});
};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment