title: Angular 4 HttpClient data mapping
body: <p>I have an api that returns ISO date that needs to be transformed into javascript date.  I am using the HTTPClient module that does the mapping automatically but it seems it is not transforming the data received.  </p>
  
  <p>I know that it works if I do it using the http module but I want to use the HTTPClient.</p>
  
  <p>My Code is below.</p>
  
  <pre><code>   export class Product{
       datetime: string;
       qty: number;
       constructor(date: string, hr: number )  {
          this.datetime = new Date(Date.parse(date));
          this.heartrate = hr;
         }
       }
  
  
  
      @Injectable()
      export class BandHeartRate {
  
          private Url  = 'http://192.168.1.1:6000';
          constructor(private http: HttpClient) {}
  
      public getProduct(): Observable&lt;Product[]&gt; {
  
              return this.http.get&lt;Product[]&gt;(`${this.Url}/web/api/v2/product`, 
      {headers: this.getHeader()});
  
          }
  
          private getHeader() {
              const header = new HttpHeaders();
              header.append('Accept' , 'application/json');
              return header;
          }
      }
      }
  </code></pre>