我有这段代码:
public ngOnInit(){
this.schemeStore.getSchemesByAffId()
.takeWhile(() => this.isAlive)
.subscribe((schemes: Scheme[]) => {
const currId = schemes[0].currency;
this.schemeFunds$ = this.fundStore
.getSchemeValorizationsByCurrency(currId);
});
}
我甚至用以下内容导入了takeWhile:
import { takeWhile } from 'rxjs/operators';
但我有这条错误消息:
ERROR TypeError: this.schemeStore.getSchemesByAffId(...).takeWhile is not a function
有人有想法吗?
答案 0 :(得分:1)
错误导入我想,试试:
import 'rxjs/add/operator/takeWhile';