title: Unable to setup Angular 2 with TypeScript in Visual Studio Code
body: <p>I'm going nuts here. I am new to JavaScript module loading and new to Angular and new to TypeScript and I can't figure out why my setup is not working. Please help!</p>
  
  <p>I have followed the <a href="https://angular.io/docs/js/latest/quickstart.html" rel="nofollow">quickstart instructions</a> from the Angular 2 site and have been able to get a running app.  Below are the key files</p>
  
  <p><strong>index.html</strong> </p>
  
  <pre><code>&lt;html&gt;
    &lt;head&gt; 
      &lt;script src="https://github.jspm.io/jmcriffey/bower-traceur-runtime@0.0.87/traceur-runtime.js"&gt;&lt;/script&gt;
      &lt;script src="https://jspm.io/system@0.16.js"&gt;&lt;/script&gt;
      &lt;script src="js/angular2.dev.js"&gt;&lt;/script&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;my-app&gt;&lt;/my-app&gt;
      &lt;script&gt;System.import('./js/app');&lt;/script&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><code>js/app.js</code> is the main component and things work, but they are very slow. I am now trying to get everything working on my local machine and to load modules using AMD (RequireJS). Here is how the new index looks:<br/><br/>
  <strong>index.html</strong> (2nd version)</p>
  
  <pre><code>&lt;html&gt;
    &lt;head&gt;
    &lt;script data-main="js/launch" src="js/require.js"&gt;&lt;/script&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;my-app&gt;&lt;/my-app&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>launch.js</strong> (in same folder as <code>app.js</code> and <code>require.js</code>)</p>
  
  <pre><code>define(["require", "exports", "angular2.dev", "app"],
    function (require, exports, angular2, app) {});
  </code></pre>
  
  <p>The app fails to run and the browser throws the following errors:<br/>
  1) <code>Error: Script error for angular2/angular2. http://requirejs.org/docs/errors.html#scripterror</code><br/>
  2) <code>TypeError: es6Promise is undefined</code><br/>
  I have tried placing <code>es6-promise.js</code> (from <a href="https://raw.githubusercontent.com/jakearchibald/es6-promise/master/dist/es6-promise.js" rel="nofollow">here</a>) in the <code>js/</code> folder and changing <code>launch.js</code> to:</p>
  
  <p><strong>launch.js</strong> (2nd version)</p>
  
  <pre><code>define(["require", "exports", "es6-promise", "angular2.dev", "app"],
    function (require, exports, es6Promise, angular2, app) {
  });
  </code></pre>
  
  <p>...but I get the same 2 errors.  I am compiling TypeScript within Visual Basic Code with the settings below:</p>
  
  <p><strong>tsconfig.json</strong></p>
  
  <pre><code>{
      "compilerOptions": {
          "target": "ES5",
          "module": "amd",
          "sourceMap": false,
          "removeComments": true,
          "noImplicitAny": false,
          "emitDecoratorMetadata":true,
          "outDir": "./js",
          "out": "app.js"
      },
      "files": [
          "ts/app.ts"
      ]
  }
  </code></pre>
  
  <p>What am I missing? why is <code>es6Promise</code> not defined? please help.</p>