title: How to increment the number by setinterval in typescript
body: <p>Tried to increment the number upto 10 after reached 10 again will start same like this : <a href="http://jsfiddle.net/dRMrL/" rel="nofollow noreferrer">http://jsfiddle.net/dRMrL/</a><br>
  I tried by typescript but not working. How to do it?</p>
  
  <pre><code>count:number=0;
  ngOnInit(){ 
    setInterval(this.myCount,500); 
  }
  
  myCount() {
  
    if (this.count &gt; 10) {
            this.count = 0;
      }
     console.log("Count form 0 to 10"+this.count);  
      this.count ++; 
  
  }
  </code></pre>
  
  <p>Demo: <a href="https://stackblitz.com/edit/angular-kma3tn?file=src/app/app.component.ts" rel="nofollow noreferrer">https://stackblitz.com/edit/angular-kma3tn?file=src/app/app.component.ts</a></p>