title: Wait for response in angular subscriber
body: <p>I have seen multiple posts with the same title but none of them is what I need for my use case. <br>I have an array of items, item property can have  ('serials','macs','null') I have to call a different API end point for each one <br> and for example inside 'model' there are an array of models <br> which also need to be sent one by one. <em>I know it's not the best way to deal</em> with this but it's a long story and I'm not responsible for this mess of a design .<br />
  the service code :</p>
  <pre><code>  createDevice(data: Device) {
      return this.http.post('somewhere', data, {
        headers: this.httpHeader,
      });
    }
  </code></pre>
  <p>component code:</p>
  <pre><code> this.sourceDataSet.forEach(item=&gt;{
  
   if(item.serials){
     item.serials.forEach(serial=&gt;{
    //create it
  
    })
    
    }
   else if(item.macs){
  
    item.macs.forEach(serial=&gt;{
    //create it
  
    })
  
    }
  else{
  
    // create it 
  
    } 
  })
  </code></pre>
  <p>the problem is there are other properties which will get affected by this and I don't want them to.
  is there a way to do this.</p>