product: Products[] = [];
Cat-Product: Products[] = [];
Type-Product: Products[] = [];
Size-Product: Products[] = [];
private loadMenu() {
this.pService.getProducts().pipe(first()).subscribe(products => {
this.product = product;
this.Cat-Product = products.filter(item => item.Category == "Cars");
this.Type-Product = products.filter(item => item.Type == "Ford");
this.Size-Product = `enter code here`products.filter(item => item.Type==="2.0");
});
}
这在角度上可能吗? 您还想要什么更多的细节?