【发布时间】:2020-11-27 06:23:50
【问题描述】:
我有来自订阅 getAllProduct() 的数据要显示在表中:
[{
"productId": 1,
"name": "Stuart UC152 Magnetic Stirrer",
"description": "Stuart UC152 Magnetic Stirrer, max. capacity 15L, Ceramic",
"isTaxable": true,
"sku": "UC512 ",
"preferredVendor": "2",
"pictures": "assets/img/product/magnetic_stirrer.jpg",
"productGroupId": 3
},
{
"productId": 2,
"name": "Dell SE2419HR 24\" ",
"description": "Dell SE2419HR 24\" Full HD IPS Monitor (HDMI, VGA, 3 Yrs Wrty)",
"isTaxable": true,
"sku": "DELL123 ",
"preferredVendor": "1008",
"pictures": "assets/img/product/lcd_monitor.jpg",
"productGroupId": 4
},
{
"productId": 3,
"name": "Dell PowerEdge T140 Tower Server",
"description": "Dell PowerEdge T140 Tower Server (E-2124, 8GB, 1TB, H330 Raid Controller)",
"isTaxable": true,
"sku": "T140 ",
"preferredVendor": "1008",
"pictures": "assets/img/product/server.jpg",
"productGroupId": 4
},
{
"productId": 4,
"name": "Lab Binocular Compound Microscope ",
"description": "AmScope 40X-2500X LED Lab Binocular Compound Microscope with 3D-Stage",
"isTaxable": true,
"sku": "DBN450 ",
"preferredVendor": "1",
"pictures": "assets/img/product/microscope.jpg",
"productGroupId": 3
}]
问题是当我尝试根据 productGroupId 在一个变量中将所有数据显示到单独的表中时。您可以从图像中看到所有产品都混合在一起,显示在两个表中,而不是根据 productGroupId 分开。谁能帮我理解如何让它显示在单独的桌子上?
【问题讨论】:
-
分享你的代码。
-
正在处理它。稍后将分享 stackblitz 链接。
标签: angular angular9 angular10