为什么onNext of Subject未解决?

时间:2016-05-06 09:27:31

标签: angular rxjs subject subject-observer

在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);

1 个答案:

答案 0 :(得分:2)

它是.next()。不是onNext()

this._subject.next(10/100);