How to create custom Angular Library easily

HostelDevta
2 min readSep 9, 2021

(part of an open source initiative by HostelDevta)

This article guide you step by step in building a custom angular library. In an companies or organization for faster developments, projects splitted into several micro projects and then library come into use to interconnect micro projects.

Angular is an application design framework and development platform for creating efficient and sophisticated single-page apps. (To learn more about Angular: https://angular.io/docs)

Prerequisites

  1. Node.js
  2. Code Editor (like Visual Studio Code, etc.)

1. Create a Project/Folder

Go to file manager, go to any directory and create a folder in it with any name of your choice. Let’s say:

myproject

2. Creating Angular Library

a. Click Ctl+Shift and Right click in mouse, menu will appear.

b. Click on”Open Powershell window here” in menu and Powershell window will appear.

c. Write this code in it:

code .

d. Visual Studio Code will get opened.

e. Click Ctrl+Shift+` to open Terminal

f. Run this code in terminal (make sure connected to Internet)

npm install @angular/cli

g. After Installation is complete, Run this code in terminal

ng new my-workspace --create-application=false

h. After Workspace gets created, Run this code in terminal

cd my-workspaceng generate library my-lib

i. Build the library for use or publishing, run this code in terminal

ng build

j. To test the library

ng test

A custom Angular library has been created successfully.

Development of Library will be discussed in another article.

Thank you for reading.

HostelDevta: Open Source Initiative is an giving back to open source community initiative as HostelDevta developed with open source applications and programs. To become the part of this initiative, email your work to support@hosteldevta.live

HostelDevta is an online hostel platform for students and bachelors which provides standardized and quality housing and food at affordable prices.

Originally published at https://luckyhero613.medium.com on September 9, 2021.

--

--

HostelDevta

**HostelDevta** is a online hostel platform for students and bachelors which provides standardized hostels at cheaper prices with lots of benefits and care