0
<form [formGroup]="filters" style="margin: 0 2px 4px;">
    <mat-card>
      <mat-card-content fxLayout="column" fxLayoutGap="7px">
        ...
        <mat-form-field>
            <input matInput formControlName="from" [owlDateTimeTrigger]="fromDate" [owlDateTime]="fromDate" placeholder="{{'timeTracking.from' | translate}}">                
        </mat-form-field>                
        <owl-date-time #fromDate></owl-date-time>
        <mat-form-field>
            <input matInput formControlName="till" placeholder="{{'timeTracking.till' | translate}}" [owlDateTimeTrigger]="tillDate" [owlDateTime]="tillDate">                
        </mat-form-field>            
        <owl-date-time #tillDate></owl-date-time>
        ...         
      </mat-card-content>
    </mat-card>
</form>

零件:

this.filters = new FormGroup({
  idItemType: new FormControl(),
  idUser: new FormControl({value: null}),
  justMe: new FormControl(false),
  isManul: new FormControl(false),
  from: new FormControl(null),
  till: new FormControl(null)
});

我可以选择一个值并按下 Set 按钮,但是在该值未保存到输入字段之后: 例子

4

0 回答 0