Hi! How to use in this case?
<div *ngFor="let product of (products | async).items"
export class StoreFrontComponent implements OnInit {
public products: Observable<ProductList>;
constructor(private productsService: ProductsService,
private shoppingCartService: ShoppingCartService) { }
ngOnInit() {
this.products = this.productsService.all()
}
public addProductToCart(product: Product): void {
this.shoppingCartService.addItem(product, 1);
}
public removeProductFromCart(product: Product): void {
this.shoppingCartService.addItem(product, -1);
}
Hi! How to use in this case?
<div *ngFor="let product of (products | async).items"