title: Angular2 HTTP GET - Cast response into full object
body: <p>I have this simple Component</p>
  
  <pre><code>import {Component} from 'angular2/core';
  import {RouterLink, RouteParams} from 'angular2/router';
  import {Http, Response, Headers} from 'angular2/http';
  import {User} from '../../models/user';
  import 'rxjs/add/operator/map';
  
  
  @Component({
      template: `
          &lt;h1&gt;{{user.name}} {{user.surname}}&lt;/h1&gt;
      `,
      directives: [RouterLink],
  })
  export class UserComponent {
  
      user: User;
  
      constructor(private routeParams: RouteParams,
          public http: Http) {
              this.user = new User();
              this.http.get('http://localhost:3000/user/' + this.routeParams.get('id'))
                  .map((res: Response) =&gt; res.json())
                  .subscribe((user: User) =&gt; this.user = user);
          console.log(this.user);
      }
  }
  </code></pre>
  
  <p>Why does <code>subscribe</code> not cast the response into a full <code>User</code> object. When I am logging the <code>user</code> variable my console say <code>User {_id: undefined, name: undefined, surname: undefined, email: undefined}</code>. But nevertheless binding to <code>.name</code> and <code>.surname</code> in the view is working..</p>
  
  <p>What happens here? Where is the user actually stored? </p>