title: AOT - Angular 6 - Directive SomeComponent, Expected 0 arguments, but got 1. for self made Component
body: <p>I am facing issue when i want to compile my current project in AOT with following package version :</p>
  
  <ul>
  <li>@ngtools/webpack@6.0.3</li>
  <li>@angular@latest (6.0.2)</li>
  <li>Webpack@4.0.0</li>
  </ul>
  
  <p><a href="https://pastebin.com/hpBeq00x" rel="noreferrer">my webpack and tsconfig.json configuration can be find here</a></p>
  
  <p>I have facing some issue related to <code>private</code> / <code>protected</code> scope used on template and some extract parameter gived to some functions who doesn't really need it (Exemple $event who are not used on EventBinding).</p>
  
  <p>Now i have this following list where i can't find where is my issue : </p>
  
  <blockquote>
    <p>/path/to/app/header/main-header/main-header.component.html(85,7): : Directive TableOfContentComponent, Expected 0 arguments, but got 1.
    (1,1): : Directive TableOfContentComponent, Expected 0 arguments, but got 1.</p>
  </blockquote>
  
  <p>my <code>main-header.component.html</code> file contain :
      // main-header.component.html
      </p>
  
  <pre><code>// main-header.component.ts
  @ViewChildren('headerItems') public headerItems: QueryList&lt;HeaderItemAbstract&gt;;
  mainMenuStates = {
      hamburger: false,
      bookmarks: false,
      search: false,
      toc: false,
      medias: false,
      article: false,
      language: false    
  };
  </code></pre>
  
  <p>And my <code>TableOfContentComponent</code> does not contain any <code>@Input</code> property.</p>
  
  <pre><code>@Component({
      selector: 'ps-table-of-content-template',
      templateUrl: './table-of-content.component.html',
      animations: [slideUpAndDownAnimation]
  })
  export class TableOfContentComponent extends HeaderItemAbstract implements OnInit {
  
      toc: TableOfContentModel[];
  
      devices: DevicesModel;
  
      tocContentHeight: number;
      tocContentMargin: number;
      menuHeight: string;
  
  
      constructor(private tableOfContentService: TableOfContentService,
                  private deviceService: DeviceService,
                  private elemRef: ElementRef) {
          super();
          this.toc = this.tableOfContentService.tableOfContent;
      }
  }
  </code></pre>
  
  <blockquote>
    <p>/path/to/app/header/main-header/hamburger-menu/hamburger-menu.component.html(125,5): : Directive SliderComponent, Expected 0 arguments, but got 1.
    (1,1): : Directive SliderComponent, Expected 0 arguments, but got 1.</p>
  </blockquote>
  
  <p>my <code>hamburger-menu.component.html</code> is close to above presented code :</p>
  
  <pre><code>&lt;ps-slider-component [template]="slidable" [countItems]="associatedDocuments.length"&gt;
      &lt;ng-template #slidable&gt;
          &lt;ul class="clearfix"&gt;
              &lt;li class="ps-hmt-associated-item-wrapper pull-left slider-item"
                  *ngFor="let document of associatedDocuments"&gt;
                  &lt;a href="{{ document.link }}" target="_blank" class="btn-nostyle"&gt;
                      &lt;div class="ps-hmt-image"&gt;
                          &lt;img src="{{ document.images.thumbnail }}" alt=""&gt;
                      &lt;/div&gt;
                      &lt;p class="ps-hmt-title slider-text"
                          [matTooltip]="isArticleView ? null : document.title"
                          [matTooltipPosition]="'above'"
                          [matTooltipClass]="['ps-mat-tooltip', 'ps-mat-tooltip-doc']"
                      &gt;
                          {{ document.title }}
                      &lt;/p&gt;
                  &lt;/a&gt;
              &lt;/li&gt;
          &lt;/ul&gt;
      &lt;/ng-template&gt;
  &lt;/ps-slider-component&gt;
  // On ts side
  associatedDocuments: Array&lt;AssociatedDocumentModel&gt;;
  @ViewChild('slidable') slidable: ElementRef;
  </code></pre>
  
  <p>And my <code>SliderComponent</code> looks like :</p>
  
  <pre><code>export class SliderComponent extends UnsubscribeHelper implements OnInit, OnChanges {
  
      @Input() template: ElementRef;
      @Input() countItems: number;
      @Input() resetSlide ?: null;
      @Input() fixedHeight?: null;
      @Input() isVariableWidth?: null;
      @Input() isBookmarks?: null;
      @Input() hasSkeleton?: boolean = false;
  </code></pre>
  
  <blockquote>
    <p>/path/to/app/header/main-header/medias/dialogs/image-dialog.component.html(34,5): : Directive CarouselComponent, Expected 0 arguments, but got 1.
    (1,1): : Directive CarouselComponent, Expected 0 arguments, but got 1.</p>
  </blockquote>
  
  <p>Really close to previous one, i thinks issue is same.</p>
  
  <blockquote>
    <p>/path/to/app/document/page/page.component.html(7,9): : Directive InfinityPageScrollComponent, Expected 0 arguments, but got 1.
    (1,1): : Directive InfinityPageScrollComponent, Expected 0 arguments, but got 1.</p>
  </blockquote>
  
  <p>Here we don't have any input on <code>InfinityPageScrollComponent</code> and tag is call like this <code>&lt;ps-infinity-page-scroll&gt;&lt;/ps-infinity-page-scroll&gt;</code></p>
  
  <p>I precise, when i disable AOT on my webpack everything work like charm. </p>
  
  <p>i have try to find solution on <a href="https://github.com/rangle/angular-2-aot-sandbox#current-status" rel="noreferrer">AoT Do's and Don'ts</a> without any result.</p>
  
  <p>I have also notice if i disable <code>fullTemplateTypeCheck</code> i am facing around 18 000 errors with some implicit any type and more strange, undefined property for my service declared on the constructor.</p>
  
  <p>--- EDIT 1 : Provide code for Abstract class : <code>UnsubscribeHelper</code>---</p>
  
  <pre><code>export abstract class HeaderItemAbstract extends UnsubscribeHelper implements AfterViewInit {
      public toggleItem: string = 'out';
      public ANIMATION_DURATION = slideUpAndDownAnimationDuration;
  
      constructor() {
          super();
      }
  
      // [Some other method]
      /**
       * Self animate after loading on DOM
       */
      ngAfterViewInit()
      {
          // Wait next to to avoid error :
          // ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked
          setTimeout(() =&gt; {
              this.toggleAnimation();
          },100);
      }
  }
  </code></pre>
  
  <p>Code for abstract class <code>UnsubscribeHelper</code> :</p>
  
  <pre><code>export abstract class UnsubscribeHelper implements OnDestroy {
  
      subscriptions: Subscription[] = [];
  
      ngOnDestroy() {
          this.subscriptions.forEach(sub =&gt; sub.unsubscribe());
      }
  
      addSubscription(subscription: Subscription) {
          this.subscriptions.push(subscription);
      }
  }
  </code></pre>