问题描述
我只是按照演示来展示一个简单的数据表.这是我的代码:
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:
我从 Firestore 获得了 Observable 行.
I get rows as Observable from Firestore.
推荐答案
您使用的 ngx-datatable
和 rxjs
版本不兼容.
The version of ngx-datatable
and rxjs
that you're using are incompatible.
如果你使用的是ngx-datatable@^12.0.0
,那么你需要rxjs@^6.0.0
.
If you're using ngx-datatable@^12.0.0
, then you need rxjs@^6.0.0
.
如果你不能升级rxjs
(因为,比如你仍然需要使用Angular的v5),那么你可以使用[email protected]
与 rxjs@^5.0.0
一起使用.
If you can't upgrade rxjs
(because, for example, you still need to use v5 of Angular), then you can use [email protected]
which works with rxjs@^5.0.0
.
这篇关于ngx-datatables 给出“rxjs_1.fromEvent is not a function";排序时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!