Cart page quantity increase function

Am creating a ecommerce app and in the cart page i need to add the ability to increase quantity of each product. Please find below the code that i wrote

<ion-row>
                    <ion-col>
                      Jeans
                    </ion-col>
                    <ion-col> 
                      <ion-icon name="remove-circle" (click)="decrement()"></ion-icon>
                        {{currentNumber}}
                      <ion-icon name="add-circle" (click)="increment()"></ion-icon>
                    </ion-col> 
                  </ion-row> 


                  <ion-row>
                    <ion-col>
                      Shirts
                    </ion-col>
                    <ion-col> 
                      <ion-icon name="remove-circle" (click)="decrement()"></ion-icon>
                        {{currentNumber}}
                      <ion-icon name="add-circle" (click)="increment()"></ion-icon>
                    </ion-col> 
                  </ion-row> 

This increases quantity for all, i need the ability to change for individual products. Many more rows will be added to cart. And should be able to display total cost of each item with reference to the quantity. So someone help

Presumably this is inside of an ngFor loop where you are looping over an array of products. If not, then make that happen and then come back here.

So you need to put a quantity property on each product and modify that instead of having it as a single controller property.

And put that increment() / decrement() function into a provider with observers if you want a nice red number in your menu bar :slight_smile:

pass the row index… it will make you to increment only that function