Search code examples
angularrxjssubjectsubject-observer

Why onNext of Subject is unsolved?


In Angular2. When I call onNext on a Subject, it shows unsolved. rx is correctly imported.

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

Solution

  • It's .next(). not onNext()

    this._subject.next(10/100);