I have this simple setup in my Angular 2 code:
IntervalObservable.create(5000)
.takeWhile(() => this.spinnerOn) // only fires when component is alive
.subscribe(() => {
this.httpService.pollResults()
.subscribe(data => {
console.log(data);
});
});
The code compiles, and i can see the takeWhile.d.ts used from rxjs node module in my IDE (IDEA). But when the app runs, i see this error in the console:
ERROR TypeError: __WEBPACK_IMPORTED_MODULE_3_rxjs_observable_IntervalObservable__.a.create(...).takeWhile is not a function
What am i doing wrong?