What is the correct expression and import for Observable.of([]);.
Observable.of([]);
import { of } from 'rxjs'; does not work for me.
import { of } from 'rxjs';
Since RxJS 6 you should import all "creation" observables directly from 'rxjs' (assuming you have path maps set when bundling your app).
'rxjs'
More detailed explanation: https://github.com/ReactiveX/rxjs/blob/master/MIGRATION.md#import-paths
import { of } from 'rxjs'; of(1).subscribe(console.log);
See demo: https://stackblitz.com/edit/typescript-e3lxkb?file=index.ts
2.1m questions
2.1m answers
60 comments
57.0k users