Angular 6 CLI Workspaces. How to create library that exports services

前端 未结 6 1482
后悔当初
后悔当初 2021-01-01 18:20

Background:

  • Angular CLI 6 introduced the concept of workspaces.
  • A workspace can contain multiple projects.
  • The workspace and projects\' con
6条回答
  •  迷失自我
    2021-01-01 18:58

    I know I am late to the party, but for future references: I got mine resolved by:

    1. ng build FormsLibModule
    2. Add the library's module to the target module and component files as follows:

    import { FormsLibModule } from 'forms-lib';

    Note: VS Code shows this import as an error, but doesn't matter because it compiles fine. Don't try to use auto-import for this import because it is not listed there.

提交回复
热议问题