Prohibited Word Example
Validation Function
prohibitedWord(): ValidatorFn {
return (c: FormControl): { [key: string]: boolean } | null => {
if (c.value) {
let regEx = new RegExp(/^.*\b(prone)\b.*?$/i);
if (regEx.test(c.value) {
return { 'prohibitedWord': true };
}
}
return null;
};
};