title: Angular2/JavaScript - Increment/Decrement by 1 on (click)
body: <p>I want to Increment/Decrement when the user presses the add button, then update the amount value accordingly. I've tried a couple of times, but unfortunately I was not successful!</p>
  
  <p>Here is the code:</p>
  
  <pre><code>  addToCart(){
    this.amount = 1;
    }
  
    addItem(){
      this.amount++;
      console.log('plus is : '+this.amount++)
    }
  
    removeItem(){
     this.amount--;
     console.log('plus is : '+this.amount--)
    }
  </code></pre>
  
  <p>HTML:</p>
  
  <pre><code>   &lt;div (click)="addToCart()"&gt;ADD&lt;/div&gt;
     &lt;div (click)="removeItem()" class="btnSign"&gt;-&lt;/div&gt; 
     &lt;div&gt;{{amount}}&lt;/div&gt; 
     &lt;div (click)="addItem()" class="btnSign"&gt;+&lt;/div&gt;
  </code></pre>