<div class="row">
<div class="col-sm-3 col-md-3 col-lg-3 col-xs-3">
<mat-form-field class="form-field-width">
<mat-label>Status</mat-label>
<mat-select (ngModelChange)="onChangeStatus($event)" [(ngModel)]="selectedStatus">
<mat-option *ngFor="let option of options" [value]="option.value">
{{option.viewValue}}
</mat-option>
</mat-select>
</mat-form-field>
</div>
<div class="col-sm-3 col-md-3 col-lg-3 col-xs-3">
<mat-form-field class="form-field-width">
<mat-label>Risk Category</mat-label>
<mat-select (ngModelChange)="onChangeRisk($event)" [(ngModel)]="selectedRisk">
<mat-option *ngFor="let risk of risks" [value]="risk.value">{{risk.viewValue}}
</mat-option>
</mat-select>
</mat-form-field>
</div>
</div>
onChangeStatus(event){
const filterValue = event;
this.dataSource.filter = filterValue.trim().toLowerCase();
}
onChangeRisk(event){
const filterValue = event
this.dataSource.filter = filterValue.trim().toLowerCase();
}
大家好,我正在尝试使用mat-select框过滤mat-table。但是我做不到。如果我们在两个选择框中都选择了选项,则表格应该对选项进行过滤。请帮忙