title: Angular won't recognize components in an imported module despite export
body: <p>I have a module for routing and, since it needs to reference the components it will route to, I have to import those as well.</p>
  
  <pre><code>import { NgModule } from "@angular/core";
  import { Routes, RouterModule } from "@angular/router";
  
  import { RegisterComponent } from "./admin/register/register.component";
  import { LoginComponent } from "./admin/login/login.component";
  import { ErrorComponent } from "./admin/error/error.component";
  
  const routes: Routes = [
    { path: "register", component: RegisterComponent },
    { path: "login", component: LoginComponent },
    { path: "**", component: ErrorComponent }
  ];
  
  @NgModule({
    imports: [RouterModule.forRoot(routes)],
    exports: [RouterModule]
  })
  export class AppRoutingModule { }
  </code></pre>
  
  <p>The components are placed in another module - <em>AdminModule</em>. All future components will be placed there (or in an appropriate module of their own). I wanted to replace the three imports with a single one like this.</p>
  
  <pre><code>// import { RegisterComponent } from "./admin/register/register.component";
  // import { LoginComponent } from "./admin/login/login.component";
  // import { ErrorComponent } from "./admin/error/error.component";
  import { RegisterComponent, LoginComponent, ErrorComponent } from "./admin/admin.module";
  </code></pre>
  
  <p>This doesn't work and the message says that the module <em>Admin</em> has no exported member with name <em>RegisterComponent</em> etc. So I added <em>exports</em> section to the decorator of the <em>AdminModule</em> class like this.</p>
  
  <pre><code>import { NgModule } from "@angular/core";
  import { CommonModule } from "@angular/common";
  import { RegisterComponent } from "./register/register.component";
  import { LoginComponent } from "./login/login.component";
  import { ErrorComponent } from "./error/error.component";
  
  @NgModule({
    imports: [CommonModule],
    exports: [RegisterComponent, LoginComponent, ErrorComponent],
    declarations: [RegisterComponent, LoginComponent, ErrorComponent]
  })
  export class AdminModule { }
  </code></pre>
  
  <p>Regrettably, the error message remains and I'm not sure how to make the components to be recognized as exportees of <em>AdminModule</em>. How come that neither <em>exports</em> section nor <em>declaration</em> section seems to expose them and what can I do to make it so recognizable?</p>