title: I want to call two observables with the second called after the first one in Angular2
body: <p>I want to call two observables with the second called after the first one.</p>
  
  <p>I have one observable that is subscribed too first.
  Then I want the second observable nested within the first observable.</p>
  
  <p><strong>I want to combine these two subscribes below:</strong></p>
  
  <pre><code>this.serviceA.getData()
  .takeUntil(destroyed$)
  .subscribe(item =&gt; {
  
  });
  
  this.serviceB.getData()
  .takeUntil(destroyed$)
  .subscribe(item =&gt; {
  
  });
  </code></pre>
  
  <p><strong>This is my attempt showing what I want to do (Updated)</strong></p>
  
  <pre><code>  destroyed$: Subject&lt;any&gt; = new Subject&lt;any&gt;();
  
    ngOnInit(): void {
      this.serviceA.getData
        .takeUntil(this.destroyed$)
        .concatMap(dataA =&gt; {
          this.myDataA= dataA;    
  
          return this.serviceB.getData;
        })
        .takeUntil(this.destroyed$)
        .subscribe(dataB =&gt; {            
  
           this.myDataA.forEach(item =&gt; {
               item.visible = dataB.find(o =&gt; o.id === item.label).isVisible;
           }); 
  
        });
    };
  
    ngOnDestroy(): void {
      this.destroyed$.next(true);
      this.destroyed$.complete();
    };
  </code></pre>
  
  <p>The aim is to have the nested subscribe called second after the first subscribe because the data is needed from the first subscriber in the second subscribe </p>