【发布时间】:2023-03-23 06:45:01
【问题描述】:
我有一个 Angular 材料数据表,它以 Angular Material 文档中描述的方式实现:
https://material.angular.io/components/table/overview#filtering
我的问题在于我的数据源,我有这个数据模型:
export interface CustomerHistory {
entity_id: number;
email: string;
name: string;
lastname: string;
cpfcnpj: string;
cpfcnpj2: string;
rg: string;
phone1: string;
phone2: string;
country: string;
state: string;
city: string;
address: string;
FullAddress: string;
cep: string;
orders: CustomerOrders[];
}
最后一个属性是 Order Array,它导致过滤器无法以与其他字段一起使用的方式正常工作
这是我的过滤功能:
applyFilter(filterValue: string) {
filterValue = filterValue.trim(); // Remove whitespace
filterValue = filterValue.toLowerCase(); // MatTableDataSource defaults to lowercase matches
this.dataSource.filter = filterValue;
}
我的问题是如何在我的数据源中搜索 Array Object 属性?
【问题讨论】:
标签: arrays angular filter angular-material