I am using Rxjs
in an angualr-cli
application.
in viewer.component.ts
//Other Imports
import { Observable } from 'rxjs/Observable';
//omitting for brevity
export class ViewerComponent implements OnInit, AfterViewInit, OnDestroy {
someFunction(someArg){
//omitting for brevity
let someArray: any = [];
//Add some info
Observable.forkJoin(someArray).subscribe(data => {
//Do something with data
});
}
//omitting for brevity
}
I get and error as
ERROR TypeError: __WEBPACK_IMPORTED_MODULE_2_rxjs_Observable__.Observable.forkJoin is not a function
at ViewerComponent.webpackJsonp../src/app/component/viewer.component.ts.ViewerComponent.someFunction(http://localhost:4200/main.bundle.js:4022:73)
at http://localhost:4200/main.bundle.js:3951:31
But if I Import Rxjs
completely (import 'rxjs';
) everything works. No error.
I cont seem to understand whats additional that needed.
I also tries importing rxjs/Observable/forkjoin
but nothing to avail.
Any pointers on how to go about this.
import 'rxjs';
– Aboveground