I am currently working on setting up a sorted DataTable in an angular application, and while implementing it using this example, I encountered the following error:
ERROR TypeError: Cannot read property 'apply' of undefined
at TableDataSource.webpackJsonp.332.TableDataSource.connect (data-table.component.ts:83)
The issue stems from the Observable.merge() method being used:
connect(): Observable<UserData[]> {
const displayDataChanges = [
this._exampleDatabase.dataChange, //BehaviorSubbject
this._sort.sortChange, //EventEmitter
];
return Observable.merge(...displayDataChanges).map(() => {
return this.getSortedData();
});
}
If anyone has insights into what may be causing this error, I would greatly appreciate it. Googling for a solution has not yielded any results so far.