title: Observable Map does not cast to typescript class
body: <p>I am using angular 2 and I am trying to call an endpoint to return a collection of objects.</p>
  
  <p>I have the following TypesScript class </p>
  
  <pre><code>export class Route
  {
      public branchId: number;
      public branch: string;
      public isTest: boolean = true;
  }
  </code></pre>
  
  <p>I have a api endpoint which returns the following Json</p>
  
  <pre><code>[{"id":610,"branch":"Coventry"},{"id":620,"branch":"Shoreham"}]
  </code></pre>
  
  <p>I have a route service which calls the endpoint using the following code</p>
  
  <pre><code>public getRoutes(): Observable&lt;Route[]&gt;
  {
      const url = 'http://localhost/routes';
  
      return this.http.get(url)
          .map((response: Response) =&gt;
          {
              const routes: Route[] = response.json() as Route[];
              if (routes.length &gt; 0) {
                  console.log(routes[0].isTest);
                  //This returns undefined I was expecting the boolean value true
              }
              return routes;
  
          }
          )
          .catch(e =&gt; this.httpErrorService.handleError(e));
  }
  </code></pre>
  
  <p>It appears that the response.json() is not being cast to data type Route. Why is this?     </p>