title: Angular - RxJS ConcatMap - Return Data From Both Service Calls
body: <p>Probably a basic question, but I have an Angular app that makes a backend service call to retrieve some data and then uses that data to make another backend service call.</p>
  
  <p>The second service call is dependent on the first completing successfully, so I use the concatMap() function from RxJS.</p>
  
  <p>However, my code below is only returning the data for the second service call. I need all the data returned from both service calls. </p>
  
  <p>Have a feeling I'm messing up the .pipe call, but not making much progress. Thanks in advance.</p>
  
  <pre><code>getData(id: String): Observable&lt;any[]&gt; {
  return this.http.get&lt;any&gt;(`${this.baseUrl}/path/${id}`).pipe(
    concatMap(
      evt =&gt;
        &lt;Observable&lt;any[]&gt;&gt;(
          this.http.get&lt;any[]&gt;(
            `${this.baseUrl}/path/relatedby/${evt.child_id}`
          )
        )
    ),
    retry(3),
    catchError(this.handleError("getData", []))
  );}
  </code></pre>