title: How to load RxJS in a minimal Angular 2 app using systemjs?
body: <p>I'm unable to get a minimal Angular 2 application using RxJS off the ground. I'm using Typescript (tsc 1.6.2) and systemjs for module loading. How do I get systemjs to load the Rx module correctly? I've run out of ideas to try and I'd appreciate any pointer to what I'm doing wrong. Module loading is a bit of magic to me. Very frustrating.</p>
  
  <p><strong>index.html</strong>:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;Title&lt;/title&gt;
      &lt;script src="../node_modules/es6-shim/es6-shim.js"&gt;&lt;/script&gt;
      &lt;script src="../node_modules/systemjs/dist/system.src.js"&gt;&lt;/script&gt;
      &lt;script src="../node_modules/rx/dist/rx.lite.js"&gt;&lt;/script&gt;
      &lt;script src="../node_modules/angular2/bundles/angular2.dev.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
      &lt;app&gt;App loading...&lt;/app&gt;
      &lt;script&gt;
          System.config({
              packages: { 'app': { defaultExtension: 'js' } }
          });
          System.import('app/app');
      &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>app.ts</strong>:</p>
  
  <pre><code>/// &lt;reference path="../../node_modules/rx/ts/rx.all.d.ts" /&gt;
  import { bootstrap, Component, View } from 'angular2/angular2';
  import * as Rx from 'rx';
  
  @Component({
      selector: 'app'
  })
  @View({
          template: `Rx Test`
  })
  export class App {
      subject: Rx.Subject&lt;any&gt; = new Rx.Subject&lt;any&gt;();
  }
  bootstrap(App);
  </code></pre>
  
  <p>SystemJS attempts to load a file that does not exist:</p>
  
  <p><a href="https://i.stack.imgur.com/eIZ5v.png" rel="noreferrer"><img src="https://i.stack.imgur.com/eIZ5v.png" alt="enter image description here"></a></p>
  
  <p>As soon as I comment out the <strong>subject</strong> in the code above, everything runs fine as there'll be no attempt to load the non-existent file (and no rx is loaded).</p>