While I was creating an Angular
application I wanted to build a library where I can put components which can be useful even in other projects. In order to create the library I've made another Angular
workspace where I've generated the library project and used the application project generated automatically within the workspace to show individual components.
ng new my-components-library
cd my-components-library
ng generate library components-library
Now I have a library with working components which pass the unit tests and works properly in the attached application project but I need them in my project's workspace. I tried to include the library on this way.
Inside my project workspace
npm install ../my-components-library/projects/components-library
the command run properly and I get a reference to the library into the host project's package.json
but when I have to include modules from the external library in a project's module using import {myModule} from 'components-library'
I get an error because Angular can't find the module.