title: Angular 2 routing resource not found
body: <p>I am using VS 2015 RC, working on a WebAPI project and when I try to use the routing in Angular 2 I get the following errors:</p>
  <blockquote>
  <p>Failed to load resource: the server responded with a status of 404 (Not Found) localhost:14580/angular2/router</p>
  <p>Potentially unhandled rejection [3] Error loading &quot;angular2/router&quot; at localhost:14580/angular2/router
  Error loading &quot;angular2/router&quot; from &quot;Components/main/main&quot; at localhost:14580/Components/main/main.js
  Not Found: localhost:14580/angular2/router (WARNING: non-Error used)</p>
  </blockquote>
  <p>The view is the basic import of the main.ts component. The component code is as follows:</p>
  <pre><code>/// &lt;reference path=&quot;../../Scripts/typings/angular2/angular2.d.ts&quot; /&gt;
  /// &lt;reference path=&quot;../../Scripts/typings/_custom/ng2.d.ts&quot; /&gt;
  
  import {Router, RouteConfig, RouterLink, RouterOutlet} from 'angular2/router';
  import {Component, View, bootstrap} from 'angular2/angular2';
  import {Login} from '../login/login';
  import {status, json} from 'Scripts/utils/fetch'
  
  
  // Annotation section
  @Component({
      selector: 'my-app'
  })
  @View({
          templateUrl: 'Views/main/main.html',
          directives: [RouterLink, RouterOutlet]
  })
  @RouteConfig([
  { path: '/login', as: 'login', component: Login }
  ])
  // Component controller
  export class Main {
      //router: Router;
      name: string;
  constructor(router: Router) {
      //this.router = router;
      this.name = 'Routing';
  
     router.config([{ path: '/login', as: 'login', component: Login }]);
  }
  
  login(event, email, password) {
      event.preventDefault();
  
      window.fetch('/api/Account/Login', {
          method: 'POST',
          headers: {
              'Accept': 'application/json',
              'Content-Type': 'application/json'
          },
          body: JSON.stringify({
              email, password
          })
      })
          .then(status)
          .then(json)
          .then((response) =&gt; {
      alert(response);
          //    this.router.parent.navigate('/home');
      })
          .catch((error) =&gt; {
          alert(error.message);
          console.log(error.message);
      });
  }
  
  }
  bootstrap(
      Main
  );
  </code></pre>