title: How to pipe / map an Observable in Angular
body: <p>A nested object is showing up as [object Object] so I'm trying to cast it via pipe and map but I'm not getting any where. I've tried the models as classes and interfaces but no help. Can someone tell me what I'm doing wrong? Thanks.</p>
  
  <p>The function:</p>
  
  <pre><code>  getClients(customerId: number): Observable&lt;Client[]&gt; {
      let clientUrl = 'SOME_URL';
      return this.http.get&lt;Client[]&gt;(clientUrl)
        .pipe(map(client: Client) =&gt; client.address as Address);
    }
  </code></pre>
  
  <p>The models:</p>
  
  <pre><code>import { Address } from './address.model';
  
  export class Client{
    id: number;
    name: string;
    accountNumber: string;
    addressId: number;
    phoneNumber: string;
    address: Address;
  }
  
  
  export class Address{
    id: number;
    name: string;
    addressLine1: string;
    addressLine2: string;
    city: string;
    postalCode: string;
  }
  </code></pre>
  
  <p>I'm getting the error:
  Error   TS2345  (TS) Argument of type 'Address' is not assignable to parameter of type 'OperatorFunction&lt;{}, Client[]>'.</p>