如何仅从角度4的订阅中获取最新值?
this.AbcSrvice.value.subscribe(data => {console.log(data)})
答案 0 :(得分:1)
使用最后一个运算符:https://www.learnrxjs.io/operators/filtering/last.html
import { last } 'rxjs/operators';
this.AbcSrvice.value
.pipe(last())
.subscribe(data => {console.log(data)});