White label for angular 2 project

百般思念 提交于 2020-01-01 02:53:05

问题


I have an Angular 2 application and I need to create a white label project based on the that. In the white label I need to alter some of the components css and also add new routes / new components. What is the recommended way to approach this?


回答1:


I would

  • create an Angular library (see https://medium.com/@tomsu/how-to-build-a-library-for-angular-apps-4f9b38b0ed11),
  • define the style parts that can be overwritten by a white-labelled consumer in a global stylesheet in the library (as opposed to in each and every individual component),
  • overwrite these parts in the white-labelled consumer applications,
  • export all relevant components (and a Routing Module) from the library,
  • import the routes and the components to the consumers, and add additional specific routes/components on top of that.


来源:https://stackoverflow.com/questions/45169551/white-label-for-angular-2-project

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