title: How do you combine multiple Observables and get the results of all in a single subscribe
body: <p>I am making multiple calls to a RESTful service. Each call gets me a results. For example, it returns objects similar to the following:</p>
  
  <pre><code>{
       results: {
            name: "Joe",
            age: 10,     
       }
  }
  </code></pre>
  
  <p>I am making 5 different calls to the service with different request parameters, and I only want to return the results to my program when all 5 calls have completed and returned their object. I would like to return to the application with an array of 5 objects like the the one above.</p>
  
  <p>How can this be done in Angular 2 with Observables?</p>
  
  <p>This is what I have tried just earlier but I cannot figure out why it won't work:</p>
  
  <pre><code>    getImage(imageUrl: string) {
  
          console.log("Fetching from " + imageUrl);
  
          return Observable.create((o) =&gt; {
              this.httpService.get(imageUrl)
              .map(res =&gt; {
                  return res.json();
              })
              .map(res =&gt; res.photos.photo[0])
              .subscribe((result) =&gt; {
                  console.log(this.generateImageUrl(result));
                  o.next(this.generateImageUrl(result));
              });
          });
      }
  
      getImages(hashtags:string[]){
          var arrayOfObservables = [];
          for (var hashtag in hashtags){
              var url = this.flickrAPI.fetchImagesByTag + hashtags[hashtag];
              var query = this.getImage(url);
              arrayOfObservables.push(query);
          }
          console.log(arrayOfObservables);
          return Observable.forkJoin(arrayOfObservables, function(){
              console.log("Fork Join Done");
              return "from Fork Join with love";
          });
      }
  </code></pre>
  
  <p>And then the subscription part happens here</p>
  
  <pre><code>onSubmit() {
          // First, clear FeedItems
          this.feedItems = [];
  
          var tweets$ = this.twitterService.getTweets(this.hashtagInput);
  
          tweets$.subscribe((tweets) =&gt; {
              for (var i in tweets) {
                  var hashtags = tweets[i].entities.hashtags;
                  var flicks$ = this.flickrService.getImages(hashtags);
                  this.subscribeToFlicks(flicks$, tweets[i]);
              }
          });
      }
  
  
      subscribeToFlicks(flicks$, tweet) {
          console.log("Here");
          flicks$.subscribe((results) =&gt; {
              console.log("Flickr Subscription:");
              console.log(results);
  
              var twitterItem = new TwitterData(tweet.user, tweet.text);
              var flickrItem = new FlickrData("null", results);
  
              var feedItem = new FeedItem(twitterItem, flickrItem);
  
              this.feedItems.push(feedItem);
          });
      }
  </code></pre>