title: How to assign Enum to variable?
body: <p>The title says it all: how do I assign an Enum to a local variable like:</p>
  
  <pre><code>export enum MyEnum {
      TOP = "top",
      RIGHT = "right",
      BOTTOM = "bottom",
      LEFT = "left"
  };
  
  const myEnum: MyEnum = MyEnum; // &lt;-Error: Type 'typeof MyEnum' is not assignable to type 'MyEnum'.
  </code></pre>
  
  <p>Link <a href="https://www.typescriptlang.org/play/index.html#src=export%20enum%20MyEnum%20%7B%0D%0A%20%20%20%20TOP%20%3D%20%22top%22%2C%0D%0A%20%20%20%20RIGHT%20%3D%20%22right%22%2C%0D%0A%20%20%20%20BOTTOM%20%3D%20%22bottom%22%2C%0D%0A%20%20%20%20LEFT%20%3D%20%22left%22%0D%0A%7D%3B%0D%0A%0D%0Aconst%20myEnum%3A%20MyEnum%20%3D%20MyEnum%3B" rel="nofollow noreferrer">here</a>.</p>
  
  <p>In order someone wonders why I would do that:
  I want to iterate over the Enum values in my AngularJs template:</p>
  
  <pre><code>// component controller
  export class MyClass {
    public myEnum: MyEnum;
  
    constructor() {
      this.myEnum = MyEnum;
    }
  }
  
  // component template
  &lt;ul&gt; 
    &lt;li ng-repeat="enum in $ctrl.myEnum"&gt;{{ enum }}&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <p>I know that I could assign every single value like:</p>
  
  <pre><code>constructor() {
    this.myEnum = {};
    this.myEnum.TOP = MyEnum.TOP;
    this.myEnum.RIGHT= MyEnum.RIGHT;
    this.myEnum.BOTTOM= MyEnum.BOTTOM;
    this.myEnum.LEFT= MyEnum.LEFT;
  }
  </code></pre>
  
  <p>But this is not what I want. Not handy, very error prone.</p>