title: How to get Enum type name in Typescript
body: <p>I have below enum in Typescript</p>
  
  <pre><code>export enum Color {
    // ... values 
  }
  </code></pre>
  
  <p>How can I get enum type name ie <code>Color</code></p>
  
  <p>I tried <code>(typeof Color).toString()</code> but it results <code>object</code></p>
  
  <h2>Why do I need this</h2>
  
  <p>I want to create a service in angular called <code>LookupService</code> which will have a method to pass <code>Color</code> as type or as generic parameter of function and will return array of value and translated text of each value of enum.</p>
  
  <p>I can pass string, but I want to use the power of typescript to make it typed and prevent typos</p>
  
  <p>my function will be like </p>
  
  <pre><code>getLookup&lt;E&gt;(): Array&lt;{key: E, text: string}&gt; 
  {
      const result = mybackend.query(name of E);
      return result
  }
  </code></pre>
  
  <p>and usage will be like below</p>
  
  <pre><code>this.lookupService.get(Color);
  this.lookupService.get&lt;Color&gt;();
  </code></pre>