Angular2 RxJS getting ‘Observable_1.Observable.fromEvent is not a function’ error

Its definitly not needed to import all operators at once! You just imported fromEvent wrong.
You could do it like this:

import {Observable} from 'rxjs/Observable';
import 'rxjs/add/observable/fromEvent';

EDIT: In addititon to what I already wrote: tree-shaking with the AoT-Compiler of angular removes unused code, based on what you import. If you just import some objects or functions from rxjs/rx, the compiler can’t remove anything. Always import just, what you need!

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)