title: Angular - specify observable return type?
body: <p>I have this part in a function :</p>
  
  <pre><code>this.myservice.getComments()
    .subscribe(data =&gt; {
      this.post.comments = data.body;
      this.post.comments_count = Number(data.headers.get('x-wp-total'));
      this.post.comments_pages = Number(data.headers.get('x-wp-totalpages'));
      this.content_ready = true;
    });
  </code></pre>
  
  <p>The <code>getComments</code> function :</p>
  
  <pre><code>export class myservice extends DataService {
    protected url = 'my_url';
  
    constructor( protected http: HttpClient ) {
      super(http);
    }
  
    getComments(){
      return this.get(
        this.subUrl, true );
    }
  }
  </code></pre>
  
  <p>Relevant part of dataService :</p>
  
  <pre><code>export class DataService {
    protected url: string;
  
    constructor(protected http: HttpClient) {}
  
    get(subUrl:string = '', needObservable = false) {
      let options = {};
      if(needObservable) {
        options = {observe: 'response'};
      }
      return this.http.get(this.url + subUrl, options);
    }
  }
  </code></pre>
  
  <p>All of this works well. The thing is, my IDE (phpstorm) is complaining about the <code>data.headers</code> and <code>data.body</code>, arguing that those properties does not exists on type 'object'.</p>
  
  <p>How to let it know that everything is fine ? I thought about typing the return but not succeeding in doing so.</p>