ngx-datatables gives “rxjs_1.fromEvent is not a function” error while sorting

荒凉一梦 提交于 2019-12-12 08:41:42

问题


I'm just following the demo to show a simple datatable. Here is my code:

columns = [
    {name: 'ID', prop: 'id'},
    {name: 'Street Address', prop: 'address.street'},
    {name: 'Suburb', prop: 'address.suburb'},
    {name: 'State', prop: 'address.state'},
    {name: 'Manager Name', prop: 'manager.name'},
    {name: 'Manager Company', prop: 'manager.company'},
  ];
<ngx-datatable #table
  class = 'material striped'
  [columns] = "columns"
  [rows] = "rows | async"
  [footerHeight] = "25" >
</ngx-datatable>

Sorting does work but, I'm also getting this error when I click on a column to sort the records:

I get rows as Observable from Firestore.


回答1:


The version of ngx-datatable and rxjs that you're using are incompatible.

If you're using ngx-datatable@^12.0.0, then you need rxjs@^6.0.0.

If you can't upgrade rxjs (because, for example, you still need to use v5 of Angular), then you can use ngx-datatable@11.3.2 which works with rxjs@^5.0.0.



来源:https://stackoverflow.com/questions/50302687/ngx-datatables-gives-rxjs-1-fromevent-is-not-a-function-error-while-sorting

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!