Atleast One Letter Example

Validation Function

 validAtleastoneletter(): ValidatorFn {
     return (control: FormControl): { [key: string]: boolean } | null => {
         if (!control.value) {
             return null;
         }
         return /[a-zA-Z]/.test(control.value) ? null : {'atleastoneletter': true};
     };
 };

View and Download Demo

results matching ""

    No results matching ""