With the recent version of Angular RC4, Rxjs is available with node_modules
or npmcdn.com
directory.
Successful plunker but not using .umd.js
http://plnkr.co/edit/B33LOW?f=systemjs.config.js&p=preview
This is the Network tab screenshot of downloading individual files.
Of course, this setup makes a lot of individual RxJS files downloading because it's reading the files indidually, not .umd.js
However, like other AngularJS files, when I try to use a single umd.js file, the following error is happening.
GET https://npmcdn.com/[email protected]/bundles/Subject 404 ()
GET https://npmcdn.com/[email protected]/bundles/Observable 404 ()
GET https://npmcdn.com/[email protected]/bundles/observable/PromiseObservable 404 ()
...
Failing plunker trying to use .umd.js
, and system.config.js
http://plnkr.co/edit/rVUNyz?p=preview&f=systemjs.config.js
systemjs.config.js
var map = {
'app': 'app',
'@angular': 'https://npmcdn.com/@angular', // sufficient if we didn't pin the version
'@angular/router': 'https://npmcdn.com/@angular/router' + routerVer,
'@angular/forms': 'https://npmcdn.com/@angular/forms' + formsVer,
'@angular/router-deprecated': 'https://npmcdn.com/@angular/router-deprecated' + routerDeprecatedVer,
'angular2-in-memory-web-api': 'https://npmcdn.com/angular2-in-memory-web-api', // get latest
'rxjs': 'https://npmcdn.com/[email protected]/bundles',
'ts': 'https://npmcdn.com/[email protected]/lib/plugin.js',
'typescript': 'https://npmcdn.com/[email protected]/lib/typescript.js',
};
//packages tells the System loader how to load when no filename and/or no extension
var packages = {
'app': { main: 'main.ts', defaultExtension: 'ts' },
'rxjs': { main: 'Rx.umd.js', defaultExtension: 'js' },
'angular2-in-memory-web-api': { main: 'index.js', defaultExtension: 'js' },
};
It seems like 'rxjs' is not using 'package' section at all.
I don't see any difference between using the rxjs
in packages section.
Only to make this plunker work, I have to change map section to the following without bundles
'rxjs': 'https://npmcdn.com/[email protected]',
My question is 'Is there a way to use Rx.umd.js with Angular2 application?'