title: Can I get metadata of generic type in typescript?
body: <p>I have a decorated model class:</p>
  
  <pre><code>@Api('payments/deposit')
  export class DepositsModel {
    public id: number;
    public created_at: Date;
    ...
  </code></pre>
  
  <p>In angular component constructor I'm injecting data service pointing to use my model class:</p>
  
  <pre><code>...
  public constructor( 
    private $api: GridApiService&lt;DepositsModel&gt;
  ...
  ) {
    this.service = new GridService($api);
    ...
  }
  ...
  </code></pre>
  
  <p>So, my cool component has a cool service, witch knows the type of data it work with...</p>
  
  <p>Should know.. </p>
  
  <p>But how I can to get my model's metadata in my GridApiService? I've tried:</p>
  
  <pre><code>@Injectable()
  export class GridApiService&lt;T&gt;{
    constructor(
      $http: HttpClient,
    ) {
      let api = Reflect.getMetadata('Api', T);
    }
  </code></pre>
  
  <p>And got  <strong>Error message: 'T' only refers to a type, but is being used as a value here.</strong></p>
  
  <p>UPDATE</p>
  
  <p>Can you advice me another way to pass initialization data to my GridApiService, witch should be injected through DI, not created with new keyword?</p>