title: Angular 2 router Error: Uncaught (in promise): TypeError: Cannot read property 'resolve' of undefined
body: <p>I am getting the following error when trying to use the router in angular 2:
  <a href="http://i.stack.imgur.com/Vcv4D.png" rel="nofollow">Error: Uncaught (in promise): TypeError: Cannot read property 'resolve' of undefined</a> and I can't figure out what's wrong with my code. Any help is really appreciated.</p>
  
  <p>I have the following files</p>
  
  <p><strong><em>main.ts</em></strong></p>
  
  <pre><code>import {bootstrap}    from 'angular2/platform/browser';
  import {AppComponent} from './app.component';
  
  bootstrap(AppComponent);
  </code></pre>
  
  <p><strong><em>app.component.ts</em></strong></p>
  
  <pre><code>import { Component } from 'angular2/core';
  import { RouteConfig, ROUTER_DIRECTIVES, ROUTER_PROVIDERS } from'angular2/router';
  import { LoginComponent } from './login.component';
  import { NotesComponent } from './notes.component';
  
  @Component({
   selector: 'my-app',
   template: `
    &lt;h1&gt; {{ title }} &lt;/h1&gt;
    &lt;nav&gt;
     &lt;a [routerLink]="['Login']"&gt;Login&lt;/a&gt;
     &lt;a [routerLink]="['Notes']"&gt;Notes&lt;/a&gt;
    &lt;/nav&gt;
    &lt;router-outlet&gt;&lt;/router-outlet&gt;
    `,
   directives: [ROUTER_DIRECTIVES],
   providers: [ROUTER_PROVIDERS]
  })
  
  @RouteConfig([
   {
     path: '/login',
     name: 'Login',
     component: LoginComponent,
     useAsDefault: true
   },
   {
    path: '/notes',
    name: 'Notes',
    component: NotesComponent
   }
  ])
  
  export class AppComponent{
   title = 'Angular 2 test';
  }
  </code></pre>
  
  <p><strong><em>login.component.ts</em></strong></p>
  
  <pre><code>import { Component } from 'angular2/core';
  import { Router } from 'angular2/router';
  
  @Component({
   selector: 'login',
   template: `&lt;h1&gt;Login Test&lt;/h1&gt;`
  })
  export class LoginComponent {
  
  }
  </code></pre>
  
  <p><strong><em>notes.component.ts</em></strong></p>
  
  <pre><code>import { Component } from 'angular2/core';
  import { Router } from 'angular2/router';
  
  @Component({
   selector: 'notes',
   template: `&lt;h1&gt;Notes Test&lt;/h1&gt;`
  })
  export class NotesComponent {
  
  }
  </code></pre>