AngularFire2 - 使用RXJS Observable.groupBy

时间:2017-11-08 21:13:16

标签: firebase angularfire2

我很难尝试将groupBy用于angularfire2(目前为5.​​0.0-rc.3)

我有以下功能:

   get(): Observable<any> {
    return this.af
        .list(this.path, ref => ref.limitToLast(100))
        .valueChanges()
        .map(list => {
            return list.map( (item:any) => {
              //Do some stuff
              return item;
            })
            //Chaining groupBy here won't work
            ;
        })
        //Chaining groupBy here does nothing (subscribe will not fire)
        .subscribe(data => { 
           //Do other stuff 
        });
  }

我需要将此列表分组到某个属性上,我无法按照RXJS doc

进行操作

https://www.learnrxjs.io/operators/transformation/groupby.html

感谢任何帮助。

0 个答案:

没有答案