title: Angular2 Exception: Can't bind to 'routerLink' since it isn't a known native property
body: <p>Obviously the beta for Angular2 is newer than new, so there's not much information out there, but I am trying to do what I think is some fairly basic routing. </p>
  
  <p>Hacking about with the quick-start code and other snippets from the <a href="https://angular.io" rel="noreferrer">https://angular.io</a> website has resulted in the following file structure:</p>
  
  <pre><code>angular-testapp/
      app/
          app.component.ts
          boot.ts
          routing-test.component.ts
      index.html
  </code></pre>
  
  <p>With the files being populated as follows:</p>
  
  <p><strong>index.html</strong></p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;html&gt;
  
    &lt;head&gt;
      &lt;base href="/"&gt;
      &lt;title&gt;Angular 2 QuickStart&lt;/title&gt;
      &lt;link href="../css/bootstrap.css" rel="stylesheet"&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/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;script src="node_modules/angular2/bundles/router.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/boot')
              .then(null, console.error.bind(console));
      &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 class="lang-js prettyprint-override"><code>import {bootstrap}    from 'angular2/platform/browser'
  import {ROUTER_PROVIDERS} from 'angular2/router';
  
  import {AppComponent} from './app.component'
  
  bootstrap(AppComponent, [
      ROUTER_PROVIDERS
  ]);
  </code></pre>
  
  <p><strong>app.component.ts</strong></p>
  
  <pre class="lang-js prettyprint-override"><code>import {Component} from 'angular2/core';
  import {RouteConfig, ROUTER_DIRECTIVES, ROUTER_PROVIDERS, LocationStrategy, HashLocationStrategy} from 'angular2/router';
  
  import {RoutingTestComponent} from './routing-test.component';
  
  @Component({
      selector: 'my-app',
      template: `
          &lt;h1&gt;Component Router&lt;/h1&gt;
          &lt;a [routerLink]="['RoutingTest']"&gt;Routing Test&lt;/a&gt;
          &lt;router-outlet&gt;&lt;/router-outlet&gt;
          `
  })
  
  @RouteConfig([
      {path:'/routing-test', name: 'RoutingTest', component: RoutingTestComponent, useAsDefault: true},
  ])
  
  export class AppComponent { }
  </code></pre>
  
  <p><strong>routing-test.component.ts</strong></p>
  
  <pre class="lang-js prettyprint-override"><code>import {Component} from 'angular2/core';
  import {Router} from 'angular2/router';
  
  @Component({
      template: `
          &lt;h2&gt;Routing Test&lt;/h2&gt;
          &lt;p&gt;Interesting stuff goes here!&lt;/p&gt;
          `
  })
  export class RoutingTestComponent { }
  </code></pre>
  
  <p>Attempting to run this code produces the error:</p>
  
  <pre><code>EXCEPTION: Template parse errors:
  Can't bind to 'routerLink' since it isn't a known native property ("
          &lt;h1&gt;Component Router&lt;/h1&gt;
          &lt;a [ERROR -&gt;][routerLink]="['RoutingTest']"&gt;Routing Test&lt;/a&gt;
          &lt;router-outlet&gt;&lt;/router-outlet&gt;
          "): AppComponent@2:11
  </code></pre>
  
  <p>I found a vaguely related issue here; <a href="https://stackoverflow.com/questions/34304115/router-link-directives-broken-after-upgrading-to-angular2-0-0-beta-0">router-link directives broken after upgrading to angular2.0.0-beta.0</a>. However, the "working example" in one of the answers is based on pre-beta code - which may well still work, but I would like to know why the code I have created is not working.</p>
  
  <p>Any pointers would be gratefully received!</p>