Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to write a reusable component/module?

I'm writing currently two new websites. Both share a lot of functionality. Is it possible with angular to write little components/modules and to reuse them in other apps? What would be the project structure for it or can I use the structure of the ng-cli?

like image 355
tschaka1904 Avatar asked Oct 29 '22 13:10

tschaka1904


1 Answers

Yeah I guess it would be possible as you get a lot of angular2 plugins where you npm install something and include it in your own project. If I was looking so have some sort shared components project I would have look at something like this and copy their project structure and how they have it set up. https://github.com/scttcper/ngx-toastr. That is just one example and there are lot of other third party plugins which you can use for inspiration.

like image 178
rtn Avatar answered Nov 15 '22 06:11

rtn