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.
'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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With