title: Observable.forkJoin and array argument
body: <p>In the Observables forkJoin documentation, it says that args can be an array but it doesn't list an example doing so: </p>
  
  <p><a href="https://github.com/Reactive-Extensions/RxJS/blob/master/doc/api/core/operators/forkjoin.md" rel="noreferrer">https://github.com/Reactive-Extensions/RxJS/blob/master/doc/api/core/operators/forkjoin.md</a></p>
  
  <p>I have tried a function similar to what I listed (below) but came up with an error:</p>
  
  <pre><code>:3000/angular2/src/platform/browser/browser_adapter.js:76 
  
  EXCEPTION: TypeError: Observable_1.Observable.forkJoin is not a function
  </code></pre>
  
  <p>A sheared version of my function below:</p>
  
  <pre><code>processStuff( inputObject ) {
    let _self = this;
  
    return new Observable(function(observer) {
      let observableBatch = [];
  
      inputObject.forEach(function(componentarray, key) {
        observableBatch.push(_self.http.get(key + '.json').map((res: Response) =&gt; res.json()));
      });
  
      Observable.forkJoin(
        observableBatch
      // );
      ).subscribe(() =&gt; {
        observer.next();
        observer.complete();
      });
  
    });
  }
  </code></pre>
  
  <p>The root of my question is related to a loop to end before proceeding as asked here: <a href="https://stackoverflow.com/questions/35566931/angular2-observable-how-to-wait-for-all-function-calls-in-a-loop-to-end-before">Angular2 Observable - how to wait for all function calls in a loop to end before proceeding?</a></p>
  
  <p>But I haven't fully mastered the correct use of forkJoin with an array and the right syntax to do so.</p>
  
  <p>I am very grateful for help you could offer.</p>
  
  <h2>NOTE: EXAMPLE OF THIRD FUNCTION THAT RETURNS AN OBSERVABLE</h2>
  
  <pre><code>thirdFunction() {
    let _self = this;
  
    return Observable.create((observer) =&gt; {
    // return new Observable(function(observer) {
      ...
  
      observer.next(responseargs);
      observer.complete();
    });
  }
  
  processStuff(inputObject) {
    let _self = this;
    let observableBatch = [];
  
    inputObject.forEach((componentarray, key) =&gt; {
      observableBatch.push(_self.thirdFunction().map((res: Response) =&gt; res.json()));
    });
  
    return Observable.forkJoin(observableBatch);
  }
  
  elsewhere() {
    this.processStuff(inputObject)
      .subscribe()
  }
  </code></pre>