ng-valid class on default select control option

时间:2018-08-09 13:55:38

标签: angular

嗨,我m using Angular 6 reactive form, and I使用浮动标签HTML,仅当字段为ng有效时,标签才会向上显示。

//我的控制

 <div class="col-md-6 col-xs-6">
    <div class="floating-label">
      <select class="floating-select" value="" formControlName="systemId" [disabled]="loginSysId!=='Admin'" #txtSysId disabled>
        <option [ngValue]="null">--Select--</option>
        <option *ngFor="let val of systemId" [ngValue]="val">{{val}}</option>
      </select>
      <span class="highlight"></span>
      <label>System Id</label>
    </div>
  </div>    

如果我m selecting the options formed from systemId variable ng-valid is applied to control, but when I选择--select--仍保持ng-invalid。请帮助我。

0 个答案:

没有答案