I\'m a beginner to Angular. I\'m watching the tutorial of Mosh Hamedani using the Angular version 6 but the problem is the tutorial version is 4. I\'m working on the e-comme
Make following changes in your code:
async addToCart(product: Product){
let cartId = await this.getOrCreateCartId();
let item$ = this.getItem(cartId, product.key);
item$.snapshotChanges().pipe(take(1)).subscribe(item => {
item$.update({ product: product,
quantity: (item.payload.exportVal().quantity || 0) + 1 });
});
}
Just check-out my Github repository My Github Link which is built in Angular 7. Your Angular 6 project will work fine.