在Angular2中。当我在主题上调用onNext时,它显示未解决。 rx已正确导入。
import { Subject } from 'rxjs/Subject';
...
private _subject = new Subject();
...
this._progress$ = Observable.create(observer => {
this._progressObserver = observer
}).share();
this._subject = Subject.create(this._progressObserver, this._progress$);
...
this._subject.onNext(10/100);
答案 0 :(得分:2)
它是.next()
。不是onNext()
this._subject.next(10/100);