Using angular-cli to create a library, other projects can install

Here is some background:

I created an angular-cli (beta 17) project for my organization that contains several components that I would like to share with other Angular 2 projects in the organization.

I started with a simple one, just using npm to install the GitHub repository into the application to implement and import the components. I thought this would work because it compiled just fine, but running the application in the browser caused a 404 error when the HTML template file for the imported component was not found.

I even tried using inline HTML templates in the component definition, but it was still trying to find the HTML file.

Is there a good way to use angular-cli to create a component library application so that other objects can install and use it? If not, what would be a good alternative? Thanks for any help.

+4
source share
3 answers

This is not currently supported by the Angular CLI, but in the future it will be supported in the future.

, , - . , npm, github, , , , . , - AoT, .

+9

@Brocco, , (. ).

, lib sample. ( diff commit , )

+1

Source: https://habr.com/ru/post/1658700/


All Articles