From the course: Learning the Angular CLI

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Generating custom library

Generating custom library - Angular Tutorial

From the course: Learning the Angular CLI

Start my 1-month free trial

Generating custom library

- [Instructor] In some projects you will come across a need to develop your own custom Angular library to be shared across teams in your organization. The Angular CLI makes it really easy for you to do this. We can do that by using ng generate library and the name for our library. In this case, I will call it my components. It goes ahead and generates files and also installs additional, necessary packages. We can go ahead and inspect our Augular.JSON file and we can see that a new project was added to our configuration. This means that our library has its own builder targets. Also, you can run specific commands for your library. Say, for instance, you want to build your library you can simply run ng build my components. You can also test your custom library. ng test my components. Then we see that the basic tests pass here. Inspecting now the projects folder, we see that we have the configuration files for our custom…

Contents