我有这样的嵌套 JSON
{"id":1,"category":"cat","iconUrl":"www.test.com","subCategoryEntity":[{"id":3,"subCategory":"sub3","products":[]},{"id":2,"subCategory":"sub2","products":[]},{"id":1,"subCategory":"sub1","products":[{"id":1,"fileDownloadUri":"http://localhost:8081/api/v1/downloadFile/paint-bucket-orange-2-300x300.jpg","productName":"Name","productPrice":20.0,"productDesc":"this is the discreption","productStock":15,"productImages":[]}]}]}
我需要遍历所有子类别并获取子类别中的所有产品
这是我的 Angular 代码
<div *ngFor="let item of allProducts| keyvalue">
{{item.key}}:{{item.value}}
</div>

