Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Share a angular library across multiple projects

Tags:

People also ask

How use generated library in another application?

To use your new Android library's code in another app or library module within the same project, add a project-level dependency: Navigate to File > Project Structure > Dependencies. Select the Module in which you'll use the library. In the Declared Dependencies tab, click and select Module Dependency in the dropdown.

What is shared library in angular?

Angular CLI includes all the tools you need to develop shared libraries that can be used in multiple applications, as long as they are all in the same workspace.

How do you share angular components between projects and apps?

To get started, go ahead and install bit-cli, then head over to the project from which to share the components, and initialize a bit workspace. Then, head over to bit. dev and create a free account. Then, create a collection to host your shared components.


I am working on a angular 7+ project which is composed of backend + frontend. Now i am shot with a requirement where i need to create one more project which comprises of frontend+backend. But there are some reusable frontend code that is present which could be reused across both the application.

My Peoject Structure

Here

Requirement

Here

So when i read about library concepts i could find

1) Create two frontend Applications and share a common library

I cannot take this approach as i am using asp.net angular template project created through the visual studio (as shown Here). The two applications (Project One and Project Two) has its own FE+BE. Hence i cannot group two FE applications inside the same folder and make them use the shared library.

2) Create the library and upload to npm and use as dependency

I cannot take this approach as the code is proprietary and cannot be shared outside the network. Also there is no local corporate npm registry to use the corporate npm.

I know this could be done using a library concept. But i am not understanding how this could be done across multiple applications. Could someone help with a solution for this. Thanks !