pjosephraj
8/13/2017 - 2:50 PM

Validators - Custom

Validators - Custom

function skuValidator(control: FormControl): { [s: string] : boolean} {
  if(!control.value.match(/^123/)) {
    return { invalidSku: true}
  }
}

// *ngIf="myForm.controls['sku'].hasError('invalidSku')"