title: TS2349: This expression is not callable. Type 'void' has no call signatures
body: <p>I'm new to angular and TS. Trying to create a component to use <code>setInterval</code> method. Here is my TS Component</p>
  <pre><code>import { Component, OnInit, EventEmitter } from '@angular/core';
  
  @Component({
    selector: 'app-gamecontrol',
    templateUrl: './gamecontrol.component.html',
    styleUrls: ['./gamecontrol.component.css']
  })
  export class GamecontrolComponent implements OnInit {
  
    constructor() { }
    counterEmitter = new EventEmitter&lt;number&gt;();
    counter = 0;
  
    initiateGame = setInterval(() =&gt; {
      this.counter++;
      this.counterEmitter.emit(this.counter);
      console.log(this.counter);
    }, 1000);
  
    stopGame = clearInterval(this.initiateGame);
  
    ngOnInit(): void {
    }
  }
  </code></pre>
  <p>And here is the HTML component calling it :</p>
  <pre><code>&lt;h3&gt;Welcome to the game of Chances&lt;/h3&gt;
  &lt;div class=&quot;container&quot;&gt;
      &lt;div class=&quot;row&quot;&gt;
          &lt;button class=&quot;btn btn-primary&quot; (click)=&quot;initiateGame()&quot;&gt;Start Game&lt;/button&gt;
      &lt;/div&gt;
      &lt;div class=&quot;row&quot;&gt;
          &lt;button class=&quot;btn btn-primary&quot; (click)=&quot;stopGame()&quot;&gt;Stop Game&lt;/button&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  <p>When I try to run the application, I get below errors :</p>
  <pre><code>RROR in src/app/gamecontrol/gamecontrol.component.html:4:50 - error TS2349: This expression is not callable.
        Type 'Number' has no call signatures.
      
      4         &lt;button class=&quot;btn btn-primary&quot; (click)=&quot;initiateGame()&quot;&gt;Start Game&lt;/button&gt;
                                                         ~~~~~~~~~~~~
      
        src/app/gamecontrol/gamecontrol.component.ts:5:16
          5   templateUrl: './gamecontrol.component.html',
                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          Error occurs in the template of component GamecontrolComponent.
      src/app/gamecontrol/gamecontrol.component.html:7:50 - error TS2349: This expression is not callable.
        Type 'void' has no call signatures.
      
      7         &lt;button class=&quot;btn btn-primary&quot; (click)=&quot;stopGame()&quot;&gt;Stop Game&lt;/button&gt;
                                                         ~~~~~~~~
      
        src/app/gamecontrol/gamecontrol.component.ts:5:16
          5   templateUrl: './gamecontrol.component.html',
                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          Error occurs in the template of component GamecontrolComponent.
  </code></pre>
  <p>Also when I declare my function like shown below, it doesn't give any error and works fine. What is the difference in both approaches?</p>
  <pre><code>initiateGame() {
    setInterval(() =&gt; {
      this.counter++;
      this.counterEmitter.emit(this.counter);
      console.log(this.counter);
    }, 1000);
  }
  </code></pre>
  <p>What exactly am I doing wrong here? Also I don't only need the working code. I need to understand why this is a problem. I tried to read few other questions with similar query, but I didn't clearly understand the issue there.</p>