Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Importing rxjs in an angular2 component gives error

Tags:

angular

rxjs

In my angular2 component, I have

import * as Rx from '@reactivex/rxjs';

The Visual Studio complaints that 'Cannot find module @reactivex/rxjs'

I see that @reactivex\rxjs is installed under node_modules under angular2. The following is the folder structure.

node_modules\angular2\node_modules\@reactivex\rxjs

How can I fix so I can use Rx in the component?

UPDATE:

A similar issue from Github.

like image 283
wonderful world Avatar asked Mar 26 '26 09:03

wonderful world


1 Answers

Which version of alpha are you using? I am using Alpha-45 and the following works for me: import * as Rx from "@reactivex/rxjs/dist/cjs/Rx";

like image 123
Vivian Avatar answered Mar 28 '26 01:03

Vivian



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!