diprokon / ng-table-virtual-scroll

Virtual Scroll for Angular Material Table
https://diprokon.github.io/ng-table-virtual-scroll
MIT License
134 stars 42 forks source link

Not working anymore since upgrading to Angular 11.1.0 #55

Closed lew89 closed 3 years ago

lew89 commented 3 years ago

ERROR TypeError: Cannot read property 'unsubscribe' of null at TableVirtualScrollDataSource._updateChangeSubscription (ng-table-virtual-scroll.js:30)

thackerc commented 3 years ago

I'm getting the same error.

leomayer commented 3 years ago

Same here - when will there be an update?

As a basic fix - just in case one needs to have it already:

import {TableVirtualScrollDataSource} from 'ng-table-virtual-scroll';
import {Subscription} from 'rxjs';

export class Angular11TableVS_DataSource<T> extends TableVirtualScrollDataSource<T> {
  _updateChangeSubscription(): void {
    this._renderChangesSubscription = new Subscription();
    super._updateChangeSubscription();
  }
}

and instead of

new TableVirtualScrollDataSource(properties); you need to write

new Angular11TableVS_DataSource(properties);