Skip to content

Instantly share code, notes, and snippets.

@StalinMazaEpn
Created August 3, 2024 04:01
Show Gist options
  • Save StalinMazaEpn/e6f812ed30196bbe2d33fc4f9087a038 to your computer and use it in GitHub Desktop.
Save StalinMazaEpn/e6f812ed30196bbe2d33fc4f9087a038 to your computer and use it in GitHub Desktop.
validationsJavascript
```js
export function validateCorporativeEmail(control: AbstractControl) {
const valueEmail: string | null = control.value;
const emailToVerify = valueEmail ||'';
const emailDomain = emailToVerify.substring(emailToVerify.indexOf("@") + 1, emailToVerify.lastIndexOf("."));
if (emailToVerify === '' || ["gmail", "outlook", "hotmail", "yahoo", "icloud", "aol", "live", "msn", "yopmail", "mail"].includes(emailDomain)) {
return { invalidCorporativeEmail: true };
}
return null;
}
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment