title: NullInjectorError: R3InjectorError(AppModule)[Router -> Router -> Router]: NullInjectorError: No provider for Router
body: <p>I've got a published library containing a component that uses [routerLink] in it's template. After installing the library in my application, I get the error <strong>NullInjectorError: R3InjectorError(AppModule)[Router -&gt; Router -&gt; Router]:
  NullInjectorError: No provider for Router!</strong></p>
  <p>Within the module in the library the RouterModule is imported and looks like this:</p>
  <pre><code>@NgModule({
    declarations: [
      Component
    ],
    exports: [
      Component
    ],
    imports: [
      CommonModule,
      RouterModule,
      TranslateModule
    ]
  })
  export class LibWithComponentModule {
  }
  </code></pre>
  <p>Within my application, the RouterModule is configured as follows:</p>
  <pre><code>const routes: Routes = [{
    path: '',
    component: RootComponent
  }];
  
  @NgModule({
    imports: [RouterModule.forRoot(routes)],
    exports: [RouterModule]
  })
  export class AppRoutingModule { }
  </code></pre>
  <p>The <code>app.module.ts</code> looks like this:</p>
  <pre><code>  declarations: [
      AppComponent,
      RootComponent
    ],
    imports: [
      BrowserModule,
      AppRoutingModule,
      LibWithComponentModule
    ],
    providers: [],
    bootstrap: [AppComponent]
  })
  export class AppModule { }
  </code></pre>
  <p>But I thought the RouterModule is going to be provided? What am I doing wrong?</p>