title: Retain JSON data after get request in Typescript
body: <p>I'am trying to call a REST api from a distant server to retrieve some usefull data. This data is meant to be injected in a Angular2 LineChart. </p>
  
  <p>I manage to retrieve the Json file and cast it to a custom Interface.</p>
  
  <p>My interface generated by Json2ts.com</p>
  
  <p><a href="https://i.stack.imgur.com/a0YHW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/a0YHW.png" alt="My interface generated by Json2ts.com"></a></p>
  
  <p>Here is my Constructor and LineChart Variables to fill with the Json Data. 
  In the constructor i cast the json result in my Interface Type: RootObject When printing the json value in console the value is Valid.</p>
  
  <p><a href="https://i.stack.imgur.com/mvFq6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mvFq6.png" alt="Here is my Constructor and LineChart Variables to fill with get request Json Data. When printing the json value in console the value is valid"></a></p>
  
  <p>I also can t assign value from the data i gather from the JSon File or i get an error of type : Cannot read property 'linechart' of undefined</p>
  
  <p><a href="https://i.stack.imgur.com/70wKr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/70wKr.png" alt="I also can t assign value from the data i gather from the JSon File"></a></p>
  
  <p>The problem is that i can't set an class data variable from the constructor, or directly set the data to the chart. Is their a way to set</p>
  
  <p>Any help will be much appreciated.</p>