计算 angularfire2.5 Observable 列表的记录数并将其放入 Colspan

Counting the number of records of an angularfire2.5 Observable list and drop it in a Colspan

我在尝试使用 angularfire2.5 RTDB 在 td colspan 中删除可观察列表的记录(成员)数量时遇到了一些问题。

我设法用下面的代码计算出这个数字

{{ (members | async)?.length }}

但我不知道如何删除 td colspan 中的数字:

<td colspan="{{ (members | async)?.length }}">

我是否必须从控制器获取号码?如果是,我该怎么做。

我正在使用以下代码获取列表:

    this.members = db.list('members').snapshotChanges().map(arr => {
  return arr.map(snap => Object.assign(snap.payload.val(), { key: snap.key }) )
})

试试这个

<td [colSpan]="(members | async)?.length">