title: StaticInjectorErro(AppModule) [ScrollableView -> Table]: No provider for table
body: <p>I'm using primeng components for my project. I wanted to use table component but I had to made some changes in the template of table component. so I made a new component that extends primeng <code>Table</code> class. then there was some errors about <code>ptablebody</code> and <code>pscrollableview</code> classes and I found out that these two components aren't declared and exported in primeng <code>TableModule</code> so I added them in <code>declarations</code> and <code>exports</code> arrays in the file <code>node_modules/primeng/components/table/table.js</code>. after that there's this errors :</p>
  
  <p>here's the code of my custom table component: <a href="https://plnkr.co/edit/Oh6fehUNoriV1p3kkNNv" rel="nofollow noreferrer">table.component.ts</a></p>
  
  <pre><code>import {Component, ElementRef,  NgZone} from '@angular/core';
      import { CommonModule } from '@angular/common';
      import {Table , TableService } from 'primeng/components/table/table';
      import { DomHandler } from 'primeng/components/dom/domhandler';
      import { ObjectUtils } from 'primeng/components/utils/objectutils';
      import { Subject, Subscription } from 'rxjs';
  @Component({
      selector: 'app-custom-table',
      template: `
          &lt;div #container [ngStyle]="style" [class]="styleClass"
              [ngClass]="{'ui-table ui-widget': true, 'ui-table-responsive': responsive, 'ui-table-resizable': resizableColumns,
                  'ui-table-resizable-fit': (resizableColumns &amp;&amp; columnResizeMode === 'fit'),
                  'ui-table-hoverable-rows': (rowHover||selectionMode), 'ui-table-auto-layout': autoLayout}"&gt;
              &lt;div class="ui-table-loading ui-widget-overlay" *ngIf="loading"&gt;&lt;/div&gt;
              &lt;div class="ui-table-loading-content" *ngIf="loading"&gt;
                  &lt;i [class]="'ui-table-loading-icon pi-spin ' + loadingIcon"&gt;&lt;/i&gt;
              &lt;/div&gt;
              &lt;div *ngIf="captionTemplate" class="ui-table-caption ui-widget-header"&gt;
                  &lt;ng-container *ngTemplateOutlet="captionTemplate"&gt;&lt;/ng-container&gt;
              &lt;/div&gt;
              &lt;p-paginator [rows]="rows" [first]="first" [totalRecords]="totalRecords" [pageLinkSize]="pageLinks" styleClass="ui-paginator-top" [alwaysShow]="alwaysShowPaginator"
                  (onPageChange)="onPageChange($event)" [rowsPerPageOptions]="rowsPerPageOptions" *ngIf="paginator &amp;&amp; (paginatorPosition === 'top' || paginatorPosition =='both')"
                  [templateLeft]="paginatorLeftTemplate" [templateRight]="paginatorRightTemplate" [dropdownAppendTo]="paginatorDropdownAppendTo"&gt;&lt;/p-paginator&gt;
  
              &lt;div class="ui-table-wrapper" *ngIf="!scrollable"&gt;
                  &lt;table #table [ngClass]="tableStyleClass" [ngStyle]="tableStyle"&gt;
                      &lt;ng-container *ngTemplateOutlet="colGroupTemplate; context {$implicit: columns}"&gt;&lt;/ng-container&gt;
                      &lt;thead class="ui-table-thead"&gt;
                          &lt;ng-container *ngTemplateOutlet="headerTemplate; context: {$implicit: columns}"&gt;&lt;/ng-container&gt;
                      &lt;/thead&gt;
                      &lt;tfoot class="ui-table-tfoot"&gt;
                          &lt;ng-container *ngTemplateOutlet="footerTemplate; context {$implicit: columns}"&gt;&lt;/ng-container&gt;
                      &lt;/tfoot&gt;
                      &lt;tbody class="ui-table-tbody" [pTableBody]="columns" [pTableBodyTemplate]="bodyTemplate"&gt;&lt;/tbody&gt;
                  &lt;/table&gt;
              &lt;/div&gt;
  
              &lt;div class="ui-table-scrollable-wrapper" *ngIf="scrollable"&gt;
                 &lt;div class="ui-table-scrollable-view ui-table-frozen-view" *ngIf="frozenColumns||frozenBodyTemplate" [pScrollableView]="frozenColumns" [frozen]="true" [ngStyle]="{width: frozenWidth}" [scrollHeight]="scrollHeight"&gt;&lt;/div&gt;
                 &lt;div class="ui-table-scrollable-view" [pScrollableView]="columns" [frozen]="false" [scrollHeight]="scrollHeight" [ngStyle]="{left: frozenWidth, width: 'calc(100% - '+frozenWidth+')'}"&gt;&lt;/div&gt;
              &lt;/div&gt;
  
              &lt;app-custom-paginator [rows]="rows" [first]="first" [totalRecords]="totalRecords" [pageLinkSize]="pageLinks" styleClass="ui-paginator-bottom" [alwaysShow]="alwaysShowPaginator"
                  (onPageChange)="onPageChange($event)" [rowsPerPageOptions]="rowsPerPageOptions" *ngIf="paginator &amp;&amp; (paginatorPosition === 'bottom' || paginatorPosition =='both')"
                  [templateLeft]="paginatorLeftTemplate" [templateRight]="paginatorRightTemplate" [dropdownAppendTo]="paginatorDropdownAppendTo"&gt;&lt;/app-custom-paginator&gt;
              &lt;div *ngIf="summaryTemplate" class="ui-table-summary ui-widget-header"&gt;
                  &lt;ng-container *ngTemplateOutlet="summaryTemplate"&gt;&lt;/ng-container&gt;
              &lt;/div&gt;
  
              &lt;div #resizeHelper class="ui-column-resizer-helper ui-state-highlight" style="display:none" *ngIf="resizableColumns"&gt;&lt;/div&gt;
  
              &lt;span #reorderIndicatorUp class="pi pi-arrow-down ui-table-reorder-indicator-up" style="display:none" *ngIf="reorderableColumns"&gt;&lt;/span&gt;
              &lt;span #reorderIndicatorDown class="pi pi-arrow-up ui-table-reorder-indicator-down" style="display:none" *ngIf="reorderableColumns"&gt;&lt;/span&gt;
          &lt;/div&gt;
      `,
      providers: [DomHandler, ObjectUtils, TableService]
  })
  export class CustomTableComponent extends Table{
  
      constructor(public el: ElementRef, 
          public domHandler: DomHandler, 
          public objectUtils: ObjectUtils, 
          public zone: NgZone, 
          public tableService: TableService) {
              super(el , domHandler . objectUtils , zone, tableService);
          }
  
  }
  </code></pre>
  
  <p>and here are the errors</p>
  
  <blockquote>
    <p>ERROR Error: StaticInjectorError(AppModule)[ScrollableView -> Table]:
        Static InjectorError(Platform: core)[ScrollableView -> Table]:
          NullInjectorEro: No Provider for Table!
          ...</p>
    
    <p>ERROR Error: StaticInjectorError(AppModule)[TableBody -> Table]:
        Static InjectorError(Platform: core)[TableBody -> Table]:
          NullInjectorEro: No Provider for Table!
          ...</p>
  </blockquote>
  
  <p>do you know how I can fix this issue?</p>