Atleast One Number Example

Validation Function

 validAtleastonenumber(): ValidatorFn {
     return (control: FormControl): { [key: string]: boolean } | null => {
         if (!control.value) {
             return null;
         }
         return /[0-9]/.test(control.value) ? null : {'atleastonenumber': true};
     };
 };

View and Download Demo

results matching ""

    No results matching ""