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

前端 未结 6 1499
后悔当初
后悔当初 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:21

    Seems like you have missed to add your service in providers array on module.

    @NgModule({
        imports: [],
        providers: [FormsLibService],
        declarations: [FormsLibComponent, FormsLibService],
        exports: [FormsLibComponent, FormsLibService],
    })
    

提交回复
热议问题