NgControlStatus

Directive automatically applied to Angular form controls that sets CSS classes based on control status. The following classes are applied as the properties become true:

@Directive({ selector: '[formControlName],[ngModel],[formControl]', host: ngControlStatusHost }) class NgControlStatus extends AbstractControlStatus { }

选择器

[formControlName] [ngModel] [formControl]

说明

  • ng-valid
  • ng-invalid
  • ng-pending
  • ng-pristine
  • ng-dirty
  • ng-untouched
  • ng-touched