Error "timeout.close is not a function" when try to clear interval - angular(5) : <p>I get this error when i do clear interval:</p>

<pre><code>ERROR Error: Uncaught (in promise): TypeError: timeout.close is not a function
TypeError: timeout.close is not a function
    at exports.clearTimeout.exports.clearInterval (main.js:14)
    at LiveTestGraphComponent.ngOnDestroy
</code></pre>

<p>The set interval function:</p>

<pre><code>this.inrvl = setInterval(() =&gt; loop(+new Date()), 5);
</code></pre>

<p>And the destroy function:</p>

<pre><code>ngOnDestroy(): void {
    if (this.inrvl) clearInterval(this.inrvl)
}
</code></pre>

<p>The component destroy with ngIf in parent component:</p>

<pre><code>&lt;test *ngIf="data.length" &lt;/test&gt;
</code></pre>
