title: Angular 7 Http Get returning '[object Object]'
body: <p>I have a service who call an API with the following function:</p>
  
  <pre><code>getAll(): Observable&lt;Client[]&gt; {
      return this.http.get&lt;Client[]&gt;(`${this.url}/clients`) 
  }
  </code></pre>
  
  <p>And in my component the service call :</p>
  
  <pre><code>  getClients() {
        this.clientService.getAll().subscribe(
        res =&gt; {
           this.clients = res;
           console.log(this.clients);
        },
        err =&gt; {
          console.log(err);
        }
  );}
  </code></pre>
  
  <p>With this, I get a response object of objects. My API is returning an Array of objects, but someway the Observable function transforms the data in an object of objects with numeric indices:
  <a href="https://i.stack.imgur.com/m6EcC.png" rel="nofollow noreferrer">Console img with error</a></p>
  
  <p>anyone knows what's the problem?</p>
  
  <h1>Solution:</h1>
  
  <p>Using KeyValue Pipe is a workaround like commented by @Suryan.
  The problem was a sort method in my API, which changed the array into an object.  It's not necessary to use pipe or map in service, as well not necessary use pipe keyvalue. @Suryan <a href="https://stackblitz.com/edit/angular7-api-response?file=src/app/app.component.html" rel="nofollow noreferrer">make an example demonstrating this point</a>.</p>