title: TypeScript: Send multiple HTTP requests sequentially Angular2
body: <p>I am sending a request to Web API and sending again another request to the same  API based on the return value from first API return. Then I am trying to map the Web API components to a class, but map method doesn't wait for second call to return. Please help that how can i map after successful return of both calls?</p>
  
  <p>Below is my code</p>
  
  <pre><code>getOrderDetail(orderId: string): Observable&lt;OrderHeader&gt; {
  
  return this.svc.wCWebClientServiceGetOrderDetails({ _orderId: orderId })
    .do(order =&gt; {
      order.SalesLines.forEach(saleLine =&gt; {
        if (saleLine.RelatedOrders !== undefined &amp;&amp; saleLine.RelatedOrders.length &gt; 0) {
          saleLine.RelatedOrders.forEach(relatedOrder =&gt; {
            this.svc.wCWebClientServiceGetOrderDetails({ _orderId: relatedOrder.TransId })
              .subscribe(relOrder =&gt; {
                //debugger;
                relOrder.SalesLines.forEach(relLine =&gt; {
                  order.SalesLines.push(relLine);
                });
              })
          });
        }
      })
    })
    //.do(order =&gt; console.log('Received order', order))
    .map(order =&gt; this.transformOrder(order));
  </code></pre>
  
  <p>}</p>