title: How to import a component from a library (in nrwl/nx with Angular)
body: <p>I would like to import my <code>PageNotFoundComponent</code> from my <code>ui-components</code> library into the router of my app.</p>
  
  <p>When I import the <code>UiComponentsModule</code> into my <code>AppModule</code> and use the components in my template, everything works just fine, but importing a component in es6 notation fails.</p>
  
  <p>/libs/ui-components/src/lib/ui-components.module.ts</p>
  
  <pre><code>import { CommonModule } from '@angular/common';
  import { NgModule } from '@angular/core';
  import { ContactCardComponent } from './contact-card/contact-card.component';
  import { NotFoundComponent } from './not-found/not-found.component';
  import { WhiteLabelFooterComponent } from './white-label-footer/white-label-footer.component';
  import { WhiteLabelHeaderComponent } from './white-label-header/white-label-header.component';
  
  @NgModule({
    declarations: [
      ContactCardComponent,
      WhiteLabelFooterComponent,
      WhiteLabelHeaderComponent,
      NotFoundComponent
    ],
    exports: [
      ContactCardComponent,
      WhiteLabelFooterComponent,
      WhiteLabelHeaderComponent,
      NotFoundComponent
    ],
    imports: [CommonModule],
  })
  export class UiComponentsModule {}
  </code></pre>
  
  <p>/apps/myApp/src/app/app-routing.module.ts</p>
  
  <pre><code>import { NgModule } from '@angular/core';
  import { RouterModule, Routes } from '@angular/router';
  import { NotFoundComponent } from 'libs/ui-components/src/lib/not-found/not-found.component';
  
  const routes: Routes = [
    {
      path: '**',
      component: NotFoundComponent,
    },
  ];
  
  @NgModule({
    exports: [RouterModule],
    imports: [RouterModule.forRoot(routes)],
  })
  export class AppRoutingModule {}
  </code></pre>
  
  <p>With an import like <code>import { NotFoundComponent } from 'libs/ui-components/src/lib/not-found/not-found.component';</code> I get the linter error:</p>
  
  <blockquote>
    <p>library imports must start with @frontend/
    (nx-enforce-module-boundaries)tslint(1) Submodule import paths from
    this package are disallowed; import from the root instead
    (no-submodule-imports)tslint(1) Module 'libs' is not listed as
    dependency in package.json (no-implicit-dependencies)tslint(1)</p>
  </blockquote>
  
  <p>When I change the import to <code>import { NotFoundComponent } from '@frontend/ui-components';</code> then I get the error:</p>
  
  <blockquote>
    <p>Module
    '"../../../../../../../../../Users/LeitgebF/Projects/KLAITONWeb/frontend/libs/ui-components/src"'
    has no exported member 'NotFoundComponent'.ts(2305)</p>
  </blockquote>
  
  <p><strong>So how do I import components directly from a library in Nx?</strong></p>