<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)
});