title: How to handle returning array with forkJoin() in Angular?
body: <p>I'm using <code>forkJoin()</code> to handle multiple observables with this code:</p>
  
  <pre><code>forkJoin([
    this.userRoleService.getAll(), // result is an array of UserRole models
    this.userService.getOne(id), // result is a single User model
    this.countyService.all(), // result is an array of County models
  ]).subscribe(([userRoles, userModel, counties]) =&gt; {
    console.log(userRoles, userModel, counties);
    // handle the result
  });
  </code></pre>
  
  <p>As you see in results I need to get two arrays and a single object. But in this scenario I get this in the console:</p>
  
  <pre><code>(2) [UserRole, UserRole]
  UserModel {api_endpoint: "user/", role: UserRole, id: 1, name: "admin", email: "admin@admin.test", …} 
  CountyModel {id: 20, name: "Hazard"}
  </code></pre>
  
  <p>Here I got one array with two of <code>UserRole</code> instances, one <code>UserModel</code> instance and one <code>CountyModel</code> instance.</p>
  
  <p>Here is the <code>county.service.ts</code>:</p>
  
  <pre><code>import { Injectable } from '@angular/core';
  import { CountyModel } from 'src/app/models/County.model';
  
  @Injectable({
    providedIn: 'root'
  })
  export class CountyService {
    db: CountyModel[] = [];
    constructor() {
      const items = JSON.parse( localStorage.getItem('counties'));
  
      items.forEach( (item: any) =&gt; {
        this.db.push(new CountyModel().init(item));
      });
    }
  
    all(): CountyModel[] {
      return this.db ? this.db : [];
    }
  }
  </code></pre>
  
  <p>So the service's <code>all()</code> method return with an array in every case. But why I get only the last element of this array as result in the <code>forkJoin</code> and how can I catch all of the array elements?</p>