简体   繁体   中英

Angular - creating a web component and using in the project

How can I change one module to a web component and use it in the project? For example I have 3 modules in the project below and I want to change only module1 to web component and use in the same project?

Thanks

Source code: https://stackblitz.com/edit/angular-8xwotj

In angular currently you can not create a web component of one separate module.

But here is a work around;-

1) create a duplicate project.

2) remove all the modules from the project except the one that you wanna use as web component.

3) convert duplicate project into the library like this

4) Lastly, Use that created library in your original project.

I hope this will help you. Let me know the results

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM