title: what is the purpose of adding generic while fetching data using API in angular app
body: <p>I am testing an angular app, I am not clear with api fetching data. I see generic (Device []) and this generic is a class with properties that is different from properties fetched by the api.  Please look at the code snippet below, I don't understand if this really affects the api fetching data.</p>
  
  <pre><code>Device.ts
  export class Device {
      DeviceId: string;
      type: String;
      idtype: String;
  }
  
  Actual compoenent.ts
  getData(){
    this.http.post&lt;Device[]&gt;('/api/getEntitlements', this.filter)
     subscribe(res =&gt; {......})
  }
  
  Data fetched by API are
  
  End Customer|Account: "jdfdbdfbh"
  End Customer|AccountName: "gefege"
  End Customer|UserEmail: "something@djdj.com"
  End Customer|UserFirstName: "",
  DeviceId:"fjhjd"
  </code></pre>
  
  <p>I see there are some additional properties that doesn't exist Device.ts and also some of the properties in Device.ts are not fetched at all. Then what is the purpose of adding Device[] while fetching data</p>