title: Using generic type parameter as parameter
body: <p>I'm trying to create a generic function which calls another function with an <code>any</code> type parameter. This is what I tried:</p>
  
  <pre><code>static GetInstance&lt;T&gt;(): T {
          return &lt;T&gt;injector.get(T); // get(param: any): any
      }
  </code></pre>
  
  <p>The problem is this doesn't compile. I'm getting <code>Cannot find name 'T'</code> error. </p>
  
  <p>I tried <code>get(typeof T)</code> but typeof T is string <code>"function"</code>.</p>
  
  <p>What can I do?</p>
  
  <p>For clarification: get() method accept types. For example you can use it like this:</p>
  
  <pre><code>import { MyService } from '..'
  
  constructor(){
      let val = this.injector.get(MyService);
  }
  </code></pre>