title: How to pass enum parameter to angular directive
body: <p>I need to pass enum as parameter to angular 6 directive, but it recognizes as a string</p>
  
  <pre class="lang-js prettyprint-override"><code>export enum MyEnum {
      SomeValue = 1
  }
  </code></pre>
  
  <p>directive code:</p>
  
  <pre><code>import { MyEnum } from '/path/';
  
  @Directive({
      selector: '[appMyDir]'
  })
  
  export class MyDirDirective {
      constructor() { }
  
      private _role: MyEnum;
  
      @Input()
      public set role(val: MyEnum) {
          this._role = val;   // string
      }
  </code></pre>
  
  <p>usage of directive:</p>
  
  <pre><code>&lt;button appMyDir role=MyEnum.SomeValue &gt;Button&lt;/button&gt;
  </code></pre>