Creating a Library with ng generate
Scaffold a library project.
Why Build a Library
When several apps need the same components, services, or utilities, you package them as an Angular library. A library is reusable, versioned, and publishable, instead of copy-pasting code between projects.
Workspaces Hold Libraries
Libraries live inside an Angular workspace: a folder managed by one angular.json that can contain multiple apps and libraries. You can add a library to an existing workspace or create a dedicated one.
ng new my-workspace --create-application=false
# a workspace with no app, ready to hold librariesAll lessons in this course
- Creating a Library with ng generate
- Public API and Entry Points
- Building with ng-packagr
- Publishing to npm