title: How to debug an Angular2 TypeScript application in Visual Studio Code?
body: <p>How do you successfully configure and debug an Angular2 TypeScript application in Visual Studio Code?</p>
  
  <p>I have tried importing the <code>es6-shim</code> and <code>reflect-metadata</code> as well with no success. The relevant code is below. Please let me know if you require further details.</p>
  
  <p>Note: I am using Angular2 Beta.</p>
  
  <p><strong>ERROR MESSAGE</strong></p>
  
  <pre><code>Debugger listening on port 24565
  c:\Users\LeviF\OneDrive\Source Code\Github\SimpleMarket\app\bin\boot.js:1
  System.register(['angular2/platform/browser', './app.component'], function(exports_1) {
  ^
  
  ReferenceError: System is not defined
      at Object.&lt;anonymous&gt; (c:\Users\LeviF\OneDrive\Source Code\Github\SimpleMarket\app\bin\boot.js:1:1)
      at Module._compile (module.js:399:26)
      at Object.Module._extensions..js (module.js:406:10)
      at Module.load (module.js:345:32)
      at Function.Module._load (module.js:302:12)
      at Module.runMain [as _onTimeout] (module.js:431:10)
      at Timer.listOnTimeout (timers.js:93:15)
  </code></pre>
  
  <p><strong>index.html</strong></p>
  
  <pre><code>&lt;html&gt;
  
    &lt;head&gt;
      &lt;title&gt;Angular 2 QuickStart&lt;/title&gt;
  
      &lt;!-- 1. Load libraries --&gt;
  
      &lt;script src="node_modules/angular2/bundles/angular2-polyfills.js"&gt;&lt;/script&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/rxjs/bundles/Rx.js"&gt;&lt;/script&gt;
      &lt;script src="node_modules/angular2/bundles/angular2.dev.js"&gt;&lt;/script&gt;
  
      &lt;!-- 2. Configure SystemJS --&gt;
      &lt;script&gt;
        System.config({
          packages: {        
            app: {
              format: 'register',
              defaultExtension: 'js'
            }
          }
        });
        System.import('app/bin/boot')
              .then(null, console.error.bind(console));
      &lt;/script&gt;
      &lt;script&gt;
  
      &lt;/script&gt;
  
    &lt;/head&gt;
  
    &lt;!-- 3. Display the application --&gt;
    &lt;body&gt;
      &lt;my-app&gt;Loading...&lt;/my-app&gt;
    &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>boot.ts</strong></p>
  
  <pre><code>//import 'reflect-metadata';
  // import 'es6-shim';
  import {bootstrap}    from 'angular2/platform/browser';
  import {AppComponent} from './app.component';
  
  // This loads our AppComponent as the ROOT Component (The app entry point)
  bootstrap(AppComponent);
  </code></pre>
  
  <p><strong>app.component.ts</strong></p>
  
  <pre><code>import {Component} from 'angular2/core';
  import {StockComponent} from './stock/stock.component';
  
  @Component({
      selector: 'my-app',
      templateUrl: 'app/src/app.view.html',
      directives: [StockComponent]
  })
  export class AppComponent{
      public name: string;
  
      getStock(){
          this.name = "hello";
          console.log('trying');
      }
  }
  </code></pre>
  
  <p><strong>Launch.json</strong></p>
  
  <pre><code>{"version": "0.2.0",
      "configurations": [
          {
              "name": "Launch type",
              "type": "node",
              "program": "app/src/boot.ts",
              "stopOnEntry": true,
              "sourceMaps": true,
              "outDir": "app/bin"
          },
          {
              "name": "Attach",
              "type": "node",
              "request": "attach",
              "port": 3000
          }
      ]
  }
  </code></pre>