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

前端 未结 6 1479
后悔当初
后悔当初 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 19:18

    You can add services you want to export from your library by adding some code into public_api.ts.

    First locate projects/nameOfLibProject/src/public_api.ts inside your angular app then add

    export * from './lib/locationOf/your.service';
    

提交回复
热议问题