DEV Community

Discussion on: How to use Web Components in HTMLTemplateElement in Angular

ppbitb profile image
ppbitb • Edited on

Googling this issue was impossible as noted. I was pointed to this post by a StackOverflow user.
Any idea or reference in the official docs why Angular is handling <template> differently?

patricksevat profile image
Patrick Sevat Author

Hi @ppbitb ,

I have not dived into this further by going into the Angular source code and I haven't found any reference to this behavior in the documentation (so far). If you do come across any information please let me know and I'll update the article!

ppbitb profile image

Thank you for your response.

I haven't found anything definitive, just sharing half-baked thoughts:

  • I dug through the angular sources, specifically the compiler package, but did not find anything. I don't have any compiler skills so that was a long shot. There is just this test that shows that template tag should be processed normally.
  • It looks like "proper" way to output a Web Component is to use an Angular Element. I have not tested this.