Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular Module has no exported member 'fromEvent'

I was trying to follow along with the official Angular tutorial on practical observable usage and attempted to import the "fromEvent":

import { fromEvent } from 'rxjs';

However, it keeps throwing an error message which states "myApp/node_modules/rxjs/Rx" has no exported member 'fromEvent'

I've already searched SO and Googled, with no luck.

like image 556
Justin F Avatar asked Oct 17 '25 07:10

Justin F


1 Answers

'fromEvent' appears to be part of Observable. You can import it like this:

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

Unlike answers elsewhere, importing "Observable" did not help, and I had to rely on VS code correctly auto suggesting where to import from (After spending quite a bit of time trying to figure out why the import did not work).

like image 198
Justin F Avatar answered Oct 19 '25 22:10

Justin F



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!