title: Angular 2 parsing JSON objects into angular classes
body: <p>I've been following the Angular2 getting started documentation to get my own app off the ground, I've been successful in retrieving JSON objects from a local file and displaying them in angular2 templates. However currently it relies on the angular classes exactly matching the structure of the objects in my JSON file. </p>
  
  <p>Eventually I'll need my app to work with JSON-LD, which has property names such as "@id". I've done some googling and it seems that RxJS might have the functionality I'm looking for but I'm not sure where to start to interupt the automatic binding from some JSON data straight into my angular2 classes, and instead be able to look up something that's labeled as "@id" in the json and set the value of SomeClass.id</p>
  
  <p>Current code that automatically produces an array of a Person class:</p>
  
  <pre><code>getPeople(){
      return this._http.get(this._peopleUrl)
          .map(response =&gt; &lt;Person[]&gt; response.json().data)
          .do(data =&gt; console.log(data)) //debug to console
          .catch(this.handleError);
  } 
  </code></pre>
  
  <p>Fine for JSON like this:</p>
  
  <pre><code>[
   {
    "id":"1",
    "name":"tessa"
   },
   {
    "id":"2",
    "name":"jacob"
   }
  ]
  </code></pre>
  
  <p>But it would obviously fail for JSON like this:</p>
  
  <pre><code>[
   {
    "@id":"1",
    "name":"tessa"
   },
   {
    "@id":"2",
    "name":"jacob"
   }
  ]
  </code></pre>
  
  <p>My class is simple (at the moment :-) )</p>
  
  <pre><code>export class Person {
    constructor(
      public id:number,
      public name:string,
    ){}
  }
  </code></pre>
  
  <p>Can anyone point me in the right direction for some documentation/examples of mapping complex/tricky json to the classes in angular2? </p>