Try debugging into the grandTotal() function to see what its return value is: get grandTotal() { this.total_price = this.quantity * this.product_price; this.sum += this.total_price; console.log('sum = ', this.sum); return this.sum; }
On Monday, July 20, 2020 at 5:53:28 AM UTC+7 maka...@gmail.com wrote: > I am getting quantity and price not just when I click onSubmit but also > when I click on the quantity buttons. This is what my quantity buttons look > like: > > <button class="minus-btn" (click)="minus(product)" type="button" name= > "btn"> > <img src="../assets/images/minus.svg" alt="minus" /></button> > <input pattern="^(0|\+?[1-9]\d*)$" class="num" name="int" [value]= > "product.nullValue" formControlName="int" ng-minlength="0" type="number"> > <button class="plus-btn" (click)="plus(product)" type="button" name="btn"> > > > > -- You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group. To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/angular/5e588b39-b44a-483c-aa61-5d461cd6d2d3n%40googlegroups.com.