title: Typescript GET object with date type
body: <p>I have python REST API and angular2 on frontend. Now I need to parse GET request to objects Answer with date type field. Example of my json:</p>
  
  <pre><code>{
  "date_answer": "2015/07/05", 
  "id": 1, 
  "text": "some text", 
  </code></pre>
  
  <p>}</p>
  
  <p>I use this code in controller:</p>
  
  <pre><code>getAnswers() : Observable&lt;Answer[]&gt; {
  return this.http.get(this.answerUrl)
            .map((res:Response) =&gt; res.json())
            .catch((error:any) =&gt; Observable.throw(error.json().error || 'Server error'));}
  </code></pre>
  
  <p>What I am trying to do is to solve my problem with parsing Date field in constructor like this:</p>
  
  <pre><code> export class Answer {
    id: number;
    text: string;
    date_answer: Date;
  
    constructor(
      id: number, 
      text: string, 
      date_string: string
      ){
        this.date_answer = new Date(date_string)
      }
  }
  </code></pre>
  
  <p>But this approach does't help. Maybe there are some better way to get date from json as Date type. </p>