title: Angular 5, using a component in a sub-module
body: <p>I am getting an error I cannot seem to remedy, when I sub-divided my app for lazy loading efficiencies
  and and using a sub-router for <code>"child"</code>,<br> I need to use a component that is used in the main app.</p>
  
  <p>But I am getting <strong>This below error message</strong></p>
  
  <blockquote>
    <p>Type AccountInfoComponent is part of the declarations of 2 modules</p>
  </blockquote>
  
  <p>My app structure looks like this</p>
  
  <pre><code>app
  |--components
      |--accountInfo
          |--accountInfo.component.ts
      |--user
          |--user.component.ts
  |--modules
      |--child
          |--child.component.ts
          |--child.module.ts
          |--child.routing.module.ts
  |--app.module.ts
  |--app.routing.module.ts
  </code></pre>
  
  <p>Where AccountInfoComponent is declaired in the main module (it is not imported to the main router, it is called via it's selector...)</p>
  
  <p>So I moved my "child" component into its own module, complete with a router (for children) and lazy loading</p>
  
  <p>My <code>"Child.router"</code> looks like this</p>
  
  <pre><code>import { NgModule } from '@angular/core';
  import { Routes, RouterModule } from '@angular/router';
  
  import { ChildComponent } from './child.component';
  import { ChildProfileComponent } from './child.profile.component';
  
  import { AccountInfoComponent } from '../../components/accountinfo/accountinfo.component';
  
  const childRoutes: Routes = [
      {
          path: '', 
          component: ChildComponent,
          children: [
              {
                  path: '',
                  component: ChildProfileComponent
              },
              {
                  path: 'account',
                  component: AccountInfoComponent 
              }
          ]
      }
  ];
  
  @NgModule({
      imports: [
          RouterModule.forChild( childRoutes )
      ],
      exports: [
          RouterModule
      ]
  })
  export class ChildRoutingModule {}
  </code></pre>
  
  <p>The main <code>app.module</code> declairs <code>AccountInfoComponent</code> because it is used in user.component.</p>
  
  <p>I have tried importing <code>AccountInfoComponent</code> into the child router, I have tried exporting it from the main module.</p>
  
  <blockquote>
    <p>QUESTION: How do I use a component in more than one module? the main app and a nested module?</p>
  </blockquote>