K
K
Konstantin2020-01-15 01:12:32
Angular
Konstantin, 2020-01-15 01:12:32

How to use the library in an angular project?

I used the ng generate library command to generate the angular library. After I executed the ng build command
Then we will get the built bible along the path /dist/library_name/
How to use it in the project, for example in app.component?
Should the library be compiled with ng build along with the main projects from which it was created? Or is it a separate project?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Shvets, 2020-01-15
@Xuxicheta

The library is built in js. Then you put these scripts in a folder nearby and add them to your project. To automate unfolding into a daddy, npm was invented.
Separate, they are independent.
The fact that they are in a subfolder relative to the default project does not mean anything.
This is done so that it is possible to immediately try out a lib or a nested app, but they are still collected separately, and an alias is added to tsconfig so that you can import from lib as if it is installed in node_modules

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question