title: Angular2 beta getting exception "No provider for Router! (RouterLink -> Router)"
body: <p>I have been banging my head against this for two days now.  I am trying to implement some simple routing in Angular2 beta0.0.2.  Please note that I am using <strong>typescript</strong>.</p>
  
  <p>So what I understand is that I need to bootstrap my root app component with <strong>ROUTER_PROVIDERS</strong> so that these services are available to my who app <strong>AND</strong> set the directives for the components that want to implement routing to <strong>ROUTER_DIRECTIVES</strong>. </p>
  
  <p>Here is what I have:</p>
  
  <pre><code>//ANGULAR  ******************************
  import {provide, Component} from 'angular2/core';
  import {bootstrap} from 'angular2/platform/browser';
  import {
          APP_BASE_HREF,
          ROUTER_DIRECTIVES,
          ROUTER_PROVIDERS,
          HashLocationStrategy,
          LocationStrategy,
          RouteConfig,
          } from 'angular2/router';
  
  //COMPONENTS  ******************************
  import {ShiftCalendarComponent} from './components/calendar/shift-calendar.component';
  import {ShiftAdminComponent} from './components/admin/shift-admin.component';
  import {ShiftListComponent} from './components/shifts/shift-list.component';
  
  //CLASS  ******************************
  @Component({
      selector: 'shift-app',
      directives: [ROUTER_DIRECTIVES],
      template: `&lt;div&gt;
                   &lt;nav&gt;
                       &lt;h3&gt; Navigation: &lt;/h3&gt;
                       &lt;ul&gt;
                           &lt;li&gt;&lt;a [routerLink]="['Calendar']" &gt; Home &lt;/a&gt;&lt;/li&gt;
                           &lt;li&gt;&lt;a [routerLink]="['Admin']" &gt; About &lt;/a&gt;&lt;/li&gt;
                           &lt;li&gt;&lt;a [routerLink]="['Shifts']" &gt; Contact us &lt;/a&gt;&lt;/li&gt;
                       &lt;/ul&gt;
                   &lt;/nav&gt;            
                   &lt;router-outlet&gt;&lt;/router-outlet&gt;
               &lt;/div&gt;`
  })
  @RouteConfig([
      { path: '/', name: 'root', redirectTo: ['/Calendar'] },
      { path: '/calendar', name: 'Calendar', component: ShiftCalendarComponent },
      { path: '/admin', name: 'Admin', component: ShiftAdminComponent },
      { path: '/shifts', name: 'Shifts', component: ShiftListComponent }
  ])
  export class ShiftApp { } 
  
  //BOOTSTRAP   ******************************
      bootstrap(ShiftApp, [
          ROUTER_PROVIDERS, 
          provide(LocationStrategy, { useClass: HashLocationStrategy }),
          provide(APP_BASE_HREF, { useValue: '/' })    
      ]);
  </code></pre>
  
  <p>The angular app loads and the template is displayed, but no link works and I get the following error in my console:</p>
  
  <blockquote>
    <p>EXCEPTION: No provider for Router! (RouterLink -> Router) angular2.dev.js</p>
  </blockquote>
  
  <p>In my index.html (which i call view.html) I have linked to all the relevant libraries and have included <strong>router.dev.js</strong> and the sources tab of my console shows me that all the needed scripts are successfully loaded.</p>
  
  <p>I have read about every stack overflow question with router link errors for Angular2 and the entire router docs but cannot find why mine is not working.  As far as I can tell my code matches <a href="https://angular.io/docs/ts/latest/guide/router.html" rel="nofollow">the Angular2 Documentation</a></p>
  
  <p><a href="https://angular.io/docs/ts/latest/api/router/ROUTER_DIRECTIVES-let.html" rel="nofollow">This documentation</a> shows that the ROUTER_DIRECTIVES includes the  directives like RouterOutlet and RouterLink</p>
  
  <h2>Question?</h2>
  
  <p>If I am successfully setting the directives for the component to <strong>ROUTER_DIRECTIVES</strong>, why am I getting the "No provider for Router! RouterLink" error?</p>