summaryrefslogtreecommitdiffstats
path: root/sdc-workflow-designer-ui/src/app/paletx/plx-text-input/validate-on-blur.directive.ts
blob: b4a940c87992027f259e28f1c0aa29fbb1957623 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import {Directive, HostListener} from '@angular/core';
import {NgControl} from '@angular/forms';

@Directive({selector: '[validateOnBlur]'})

export class PlxValidateOnBlurDirective {
  constructor(private formControl: NgControl) {}

  @HostListener('focus')
  onFocus() {
    // this.formControl.control.markAsUntouched(false);
  }

  @HostListener('blur')
  onBlur() {
    // this.formControl.control.markAsTouched(true);
  }
}