title: How to return HttpClient subscribe data to a component
body: <p>I'm trying to return data from a service using subscribe method. </p>
  
  <pre><code>import { Injectable } from '@angular/core';
  import { HttpClient } from '@angular/common/http';
  
  @Injectable()
  export class DevRequestService {
      constructor(private http: HttpClient){}
      getListOfAgencies() {
          return this.http.get('https://example.com/api/agency').subscribe(data =&gt; {
              return data;
            });
      }
  }
  </code></pre>
  
  <p>Component:</p>
  
  <pre><code>ngOnInit(): void {
    console.log(this.devRequestService.getListOfAgencies());
  }
  </code></pre>
  
  <p>Below is the output that I'm getting in console.log instead of returning the object with the values:</p>
  
  <p><code>Subscriber {closed: false, _parent: null, _parents: null, _subscriptions: Array(1), syncErrorValue: null, …}</code></p>