带有异步管道的Mat-table [dataSource]

时间:2019-02-11 04:54:50

标签: angular asynchronous angular-material observable

仅花费了几个小时就试图弄清楚为什么<table mat-table [dataSource]="data|async"> ...没有更新,而为data发出了新值。...

2 个答案:

答案 0 :(得分:0)

...事实证明,async管道不仅不需要,而且以某种方式破坏了更改检测。因此,将dataSource与Observable一起使用的正确方法是不带管道就给它数据。

答案 1 :(得分:0)

您的数据属性不是可观察的。这就是为什么它不起作用。

相关问题