Skip to content Skip to sidebar Skip to footer

How To Load Rxjs (and Zone.js / Reflect-metadata) With Angular 2 (beta And Newer)?

As of Angular 2 Alpha 54 (changelog), RxJS is no longer included in Angular 2. Update: Turns out that zone.js and reflect-metadata are also excluded. As a result, I now get the fol

Solution 1:

So it turns out that the problem was fixed easily by changing the SystemJS config to the following in my index.html file:

System.config({
    map: {
        rxjs: 'node_modules/rxjs'// added this map section
    },
    packages: {
        'app': {defaultExtension: 'js'},
        'rxjs': {defaultExtension: 'js'} // and added this to packages
    }
});
System.import('app/app');

I had actually tried that, but what I failed to realize was that zone.js and reflect-metadata were also no longer included in Angular 2, and I was running into that problem as well.

For those interested, I got around the lack of zone.js and reflect-metadata most easily by including the angular2-polyfills.js file in my index.html:

<scriptsrc="../node_modules/angular2/bundles/angular2-polyfills.js"></script>

Now my app works just as it did with Alpha 53.

Post a Comment for "How To Load Rxjs (and Zone.js / Reflect-metadata) With Angular 2 (beta And Newer)?"