swimlane / ngx-datatable

✨ A feature-rich yet lightweight data-table crafted for Angular
http://swimlane.github.io/ngx-datatable/
MIT License
4.62k stars 1.68k forks source link

Scrolling server-side production build error #1943

Open Yadhunandansolus opened 3 years ago

Yadhunandansolus commented 3 years ago

Current behavior

Getting production build error for Scrolling server-side. Getting error as "Directive ɵc, Expected 2 arguments, but got 1" Error pointing to ngx-datatable tag

if i remove (scroll)="onScroll($event.offsetY)" its building successfully

  <ngx-datatable
  #table
  class="material server-scrolling-demo"
  [rows]="rows"
  [offset]="tableOffset"
  [headerHeight]="headerHeight"
  [footerHeight]="footerHeight"
  [rowHeight]="rowHeight"
  [columnMode]="ColumnMode.force"
  [loadingIndicator]="isLoading"
  [scrollbarV]="true"
  [scrollbarH]="true"
  (scroll)="onScroll($event.offsetY)"
  >

ErrorCapture

Expected behavior

It has to build successfully

kattn commented 3 years ago

hard to tell without seeing the onScroll function. But it might be the same bug I got into. As the (scroll) listener catches both the scrollEvent from ngx-datatable(https://swimlane.gitbook.io/ngx-datatable/api/table/outputs#scroll) and the Element scroll https://developer.mozilla.org/en-US/docs/Web/API/Element/scroll_event your function needs to handle this.