Casting results from Observable.forkJoin to their respective types in Angular 2 : <p>Let say I have a component in Angular 2 that needs to load 2 different things from the server before the page is displayed.  I'd like all of those things to fire off and call one event handler when they come back telling the page isLoaded = true. Let's say I have a service class that looks like this.</p>

<pre><code>export class MyService {
   getStronglyTypedData1(): Observable&lt;StrongData1[]&gt;{
      return this.http.get('http://...').map((response:Response) =&gt; &lt;StrongData1[]&gt;response.json());
   }
   getStronglyTypedData2(): Observable&lt;StrongData2[]&gt;{
         return this.http.get('http://...').map((response:Response) =&gt; &lt;StrongData2[]&gt;response.json());
   }
}
</code></pre>

<p>Then I have a component that uses that service class like this.</p>

<pre><code>export class MyComponent implements OnInit {
   isLoaded = false;
   stronglyTypedData1: StrongData1[];
   stronglyTypedData2: StrongData2[];

   constructor(private myService:MyService){ }

   ngOnInit(){
      var requests [ 
         this.myService.getStronglyTypedData1(),
         this.myService.getStronglyTypedData2()
      ];
      Observable.forkJoin(requests).subscribe(
         results =&gt; {
            this.stronglyTypedData1 = results[0];
            this.stronglyTypedData2 = results[1];
            this.isLoaded = true;
         });
   }
}
</code></pre>

<p>The TypeScript compiler is complaining that it cant convert type object to type StrongData1[]. If I change StrongData1 and StrongData2 to "any", everything works fine.  I'd rather not do that though because I'm losing the benefit of TypeScript's strong typings. </p>

<p>How do I cast the results from forkJoin to their respective types?</p>
