title: Setting http response type in Angular
body: <p>I am trying to set the type of response that my server sends, but it is giving me error</p>
  <pre><code>this.garageService.garageList.subscribe((resp: ApiResp) =&gt; {
    this.garageList = resp.content
  });
  </code></pre>
  <p>Here is the <code>ApiResp</code> interface that I created</p>
  <pre><code>export interface ApiResp {
    success: boolean;
    content: any;
  }
  </code></pre>
  <p>here is the error that I am getting
  <a href="https://i.stack.imgur.com/5KPX5.png" rel="nofollow noreferrer">Error screenshot</a></p>
  <p>and here is how I am making my http request</p>
  <pre><code>  async getGaragelist() {
      try
      {
        let resp: any = await this.http.post&lt;ApiResp&gt;(this.baseURL + '/getAllGarages', { target: 'admin' }).toPromise()
        this.garageList.next(resp)
      }
      catch (error)
      {
        console.log('Error occurred while fetching garages: ', error);
  
      }
    }
  </code></pre>