title: Angular 8/9 Keeps calling subscribe for json in a loop
body: <p>I only want to get the result from this json call once.
  But in the console window I can see it is getting called in a loop.</p>
  
  <p><strong>the component:</strong></p>
  
  <pre><code> constructor(private dataService: DataService) {
  
  
      this.dataService.getData()
        .subscribe((data) =&gt; {
          console.log("DATA" + data); // keeps going forever
          this.info = data;
  
        });
  
    }
  </code></pre>
  
  <p><strong>the service</strong></p>
  
  <pre><code>    getData(): Observable&lt;any&gt; {
          return this.http.get("https://example.com/info")
  
    }
  </code></pre>