import { AbstractControl, Validators, ValidatorFn } from '@angular/forms';

import { isPresent } from '../../integer';

export const textinput: ValidatorFn = (control: AbstractControl): {[key: string]: boolean} => {
  if (isPresent(Validators.required(control))) return null;

  let v: string = control.value;
  return /^[a-zA-Z]+$/.test(v) ? null : {'textinput': true};
};
 //  /^\d+$/.test(v)