title: Angular 2: Routerlink not working in header component
body: <p>I have a RC5 app with the following setup:</p>
  
  <p>main.ts:</p>
  
  <pre><code>// Dynamic (JIT) compiler
  import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
  
  // Our main app module
  import { AppModule } from './app.module';
  
  // Compile and launch the module
  platformBrowserDynamic().bootstrapModule(AppModule);
  </code></pre>
  
  <p>app.module.ts:</p>
  
  <pre><code>@NgModule({
    imports: [BrowserModule, routing, SharedModule.forRoot()],
    declarations: [AppComponent, ErrorComponent],
    bootstrap: [AppComponent]
  })
  export class AppModule {}
  </code></pre>
  
  <p>shared.module.ts:</p>
  
  <pre><code>@NgModule({
      imports: [CommonModule, HttpModule],
      declarations: [TranslatePipe, DateToStringPipe, HeaderComponent],
      exports: [TranslatePipe, DateToStringPipe, CommonModule, FormsModule, ReactiveFormsModule, HeaderComponent]
  })
  
  export class SharedModule {
  
      static forRoot(): ModuleWithProviders {
  
          return {
              ngModule: SharedModule,
              providers: [
                  FeedbackService,
                  CookieService,
                  AuthService,
                  LoggerService,
                  RouteGuard,
                  {
                    provide: TranslateLoader,
                    useFactory: (http: Http) =&gt; new TranslateStaticLoader(http, 'app/languages', '.json'),
                    deps: [Http]
                  },
                  TranslateService,
                  SearchService,
                  SharedComponent,
                  HeaderComponent
              ]
          };
  
      }
  
  }
  
  @NgModule({
      exports: [SharedModule],
      providers: []
  })
  export class SharedRootModule {}
  </code></pre>
  
  <p>I use <code>&lt;router-outlet&gt;&lt;/router-outlet&gt;</code> to show each module in the application and it works fine. </p>
  
  <p>But I can't use "routerlink" inside my <code>HeaderComponent</code>. If I move the markup to my <code>AppComponent</code> it works, so there is no markup problem. </p>
  
  <p>All other components that gets loaded inside the <code>&lt;router-outlet&gt;</code> can use "routerlink". </p>
  
  <p>What am I doing wrong with the <code>HeaderComponent</code> ?</p>