title: Can't resolve all parameters for custom directive
body: <p>I created a custom directive to open a link in a new tab, when running in ng serve, it works. However, when I tried in ng build --prod, it showed this error: </p>
  
  <p>ERROR in Can't resolve all parameters for OpenLinkInNewTabDirective in C:/Users/myApp/src/app/directives/open-link-in-new-tab.directive.ts: ([object Object], ?).</p>
  
  <p>Here is the directive: </p>
  
  <pre><code>import { Directive, ElementRef, HostListener, Input, Inject } from '@angular/core';
  
  @Directive({ selector: '[newTab]' })
  export class OpenLinkInNewTabDirective {
      constructor(
        private el: ElementRef,
        @Inject(Window) private win:Window
      ) {}
  
      @Input('routerLink') link: string;
      @HostListener('mousedown') onMouseEnter() {
          this.win.open(this.link || 'main/default');
      }
  }
  </code></pre>
  
  <p>I set "emitDecoratorMetadata": true in tsconfig.json already. 
  Thank you in advance. </p>