title: Angular Timer to count the time
body: <p>I am trying to create a timer to count the time from 0.</p>
  
  <p>However, when I click the button the time is not counting, does anyone know why?</p>
  
  <p>How can I get this timer in this format {{hours}}: {{mminutes}}: {{sseconds}}?</p>
  
  <p>Thanks!</p>
  
  <p><strong>My code</strong></p>
  
  <p><a href="https://stackblitz.com/edit/angular-fojamd" rel="noreferrer">Stackblitz</a></p>
  
  <p><strong>Component.ts</strong></p>
  
  <pre><code>time: number = 0;
  interval;
  
  startTimer() {
      this.interval = setInterval(() =&gt; {
          if(this.time = 0) {
              this.time++;
          } else {
              this.time= 0;
          }
      },1000)
  }
  
  pauseTimer() {
      clearInterval(this.interval);
  }
  </code></pre>