我有一个用 firebase/fireStore 制作的 observable。如果我在组件中订阅这个 observable,它就可以工作。但是如果我通过管道传输这个 observable,即使我期望它也不起作用。而且我没有收到任何错误。我的问题; 为什么它不起作用?
我的代码;
服务;
getLastSeans(uid) {
return this.afs.doc<any>(`users/${uid}/lastseans/seansLive`).valueChanges();
}
零件;
用管道它不起作用
this.roomService.getLastSeans(this.userId).pipe(map(x=>{console.log(x);return x;}));
如果我订阅它就像这样工作;
this.roomService.getLastSeans(this.userId).subscribe(x=>console.log(x));
我想知道为什么会这样?