create angular library from whole angular's app

江枫思渺然 提交于 2019-12-11 23:24:43

问题


I work on angular 5 application that use material module as a UI interface, i create template for all my projects and i want projects use this application as a library and my changes to general part of template [sidebar, navigationbar] update on library and apply to all projects. is this a good pattern? if this possible, how to do this in angular 5?


回答1:


If you want to create a reusable library you can use ng-packagr ng-packagr is a node library that can compile and package a TypeScript library to Angular Package Format. it is commonly used for pulling components out of CLI project and package them up into a format that can be used within other Angular applications.
execute npm install ng-packagr --save-dev

Refer this Building an Angular 4 Component Library with the Angular CLI and ng-packagr.



来源:https://stackoverflow.com/questions/50186969/create-angular-library-from-whole-angulars-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!