title: Subscribe to multiple async http calls
body: <p>on ngOnInit i make 4 http request for data, after that i need to load the data from server to fill the forms with the data based on data model of last 4 http call.</p>
  
  <p>In short words i need to subscribe to this 4 http calls, and make sure don't fail if they don't fail finally i can call the 5th http call to get data from server.</p>
  
  <p>From what i understand, i should avoid to inest a observable and go with switch, but how to do this with 4 http call? should i create an observable wait for the http calls and if succed to use switchmap on the 5th http call?</p>
  
  <p>This is the code.</p>
  
  <pre><code>      ngOnInit() {
      this.service.getProvince().subscribe(
          (value) =&gt; { return value; },
          (error: AppError) =&gt; {
              if (error instanceof NotFoundError) {
                  console.log('Error richiesta http');
              } else {
                  console.log(error);
              }
          });
  
  
      this.service.getLingueStraniere().subscribe(
          (value) =&gt; { return value; },
          (error: AppError) =&gt; {
              if (error instanceof NotFoundError) {
                  console.log('Error richiesta http');
              } else {
                  console.log(error);
              }
          });
  
      this.service.getTitoliPreferenziali().subscribe(
          (value) =&gt; { return value; },
          (error: AppError) =&gt; {
              if (error instanceof NotFoundError) {
                  console.log('Error richiesta http');
              } else {
                  console.log(error);
              }
          });
  
      this.service.getRiserve().subscribe(
          (value) =&gt; { return value; },
          (error: AppError) =&gt; {
              if (error instanceof NotFoundError) {
                  console.log('Error richiesta http');
              } else {
                  console.log(error);
              }
          });
  }
  
  
  // this is the 5th call that need to be done only if last 4 call not fail
  
  finalCall {
      this.service.getDomanda().subscribe((domanda: any) =&gt; {
          this.popolaForm(domanda); // Method that use data to fill foms
      },
          (error: AppError) =&gt; {
              if (error instanceof NotFoundError) {
                  console.log('Error richiesta http');
              } else {
                  console.log(error);
              }
          });
  } 
  </code></pre>