4
votes

Please help me to create a simple angular2 library project(which has just an angular2 component). After this I need to reuse this library component in another project(which is created using angular cli command).

Basically export an angular2 component from library project, publish it to npm and import from another angular project..

Thanks in advance.

1
Did you managed to do so with angular2 release ? - Haddar Macdasi

1 Answers

0
votes

I have managed to create an angular library using this library generator library. There is also described in great detail how to wire everything up.

This will give you a basic library structure that works out of the box. To customize it a bit further and adjust it to your needs you can access the source code of already existing angular libraries (for example) on Github and see how they are doing their exports etc.