Reactive-Extensions / RxJS

The Reactive Extensions for JavaScript
http://reactivex.io
Other
19.48k stars 2.1k forks source link

How to import Rx in Angular2 RC4 #1270

Open blackhawk389 opened 8 years ago

blackhawk389 commented 8 years ago

I find no module exporting Rx tried import {Rx} from rxjs/Rx nothing worked

code0wl commented 8 years ago

@blackhawk389 I have you tried https://www.npmjs.com/package/rxjs-es ? Then you can import specific modules or just the whole lib by: import Rx from 'rxjs/Rx';

This one worked well for me using webpack setup with babel import statements

blackhawk389 commented 8 years ago

I also tried same way like i said earlier, i'm importing module which is installed as dependency of Angular2, is it okay or I have to install it separately using npm command, btw im using system.js

ngthduy90 commented 8 years ago

@blackhawk389 Is your public folder a root project folder ? /your_project |---/node_modules

If you're not sure, so i suggest you config your systemjs.config like this:

    var map = {
        'rxjs' : 'https://npmcdn.com/rxjs@5.0.0-beta.6'
    };

    var packages = {
        'rxjs': {main: 'Rx.js', defaultExtension: 'js'}
    };