【发布时间】:2021-11-16 19:03:22
【问题描述】:
我有一个嵌套数组,我想用 mat-table 显示它。
数组中有两个不同的模块“Flex”,它们有几个位置要显示在表格中。
由于数组中有两个“Flex”模块,所以也应该像这个例子一样显示两个表格:
灵活
| Position | ID | Menge | Bezeichnung | BP_Gesamt |
|---|---|---|---|---|
| 1 | STZBH | 2 | Xpress weiss | 1998,00 |
| 2 | STZBG | 5 | Xpress schwarz | 3998,00 |
灵活
| Position | ID | Menge | Bezeichnung | BP_Gesamt |
|---|---|---|---|---|
| 1 | STZBH | 4 | Xpress weiss | 3996,00 |
| 2 | STZBG | 4 | Xpress schwarz | 3996,00 |
[
{
"module": "Flex",
"positionen": [
{
"Position": 0,
"ID": {
"id": "XLEW_1_2_2",
"wert": "STZBH"
},
"Menge": {
"id": "XLEW_1_2_5",
"wert": "2"
},
"Bezeichnung": {
"id": "XLEW_1_2_6",
"wert": "Xpress weiss"
},
"BP_Gesamt": {
"id": "XLEW_1_2_17",
"wert": "1998,00"
}
},
{
"Position": 1,
"ID": {
"id": "XLEW_1_2_2",
"wert": "STZBH"
},
"Menge": {
"id": "XLEW_1_2_5",
"wert": "5"
},
"Bezeichnung": {
"id": "XLEW_1_2_6",
"wert": "Xpress weiss"
},
"BP_Gesamt": {
"id": "XLEW_1_2_17",
"wert": "3998,00"
}
}
]
},
{
"module": "Flex",
"positionen": [
{
"Position": 0,
"ID": {
"id": "XLEW_1_2_2",
"wert": "STZBH"
},
"Menge": {
"id": "XLEW_1_2_5",
"wert": "4"
},
"BP_Gesamt": {
"id": "XLEW_1_2_17",
"wert": "3996,00"
}
},
{
"Position": 1,
"ID": {
"id": "XLEW_1_2_2",
"wert": "STZBG"
},
"Menge": {
"id": "XLEW_1_2_5",
"wert": "4"
},
"Bezeichnung": {
"id": "XLEW_1_2_6",
"wert": "Xpress schwarz"
},
"BP_Gesamt": {
"id": "XLEW_1_2_17",
"wert": "3996,00"
}
}
]
}
]
我是 Angular 和 mat-table 的新手,找不到解决问题的方法。
谁能帮帮我
【问题讨论】: