2

I'm writing an angular custom element. Rather than explaining the whole thing I have uploaded the code to the following url

https://github.com/arjunagl/angular-custom-elememtns

However when I add the code to a standard html page like the following

Hello World, this is where the custom element should come

I get the following error The selector "app-contact-form" did not match any elements. Seems like its still trying to search by the actual name of the component rather than the name I registered it by customElements.define('my-contact-form', el);. Furthermore even if I change the registration name to the same name app-contact-form I get the same error

This is the command I run to generate the output ng build --prod --output-hashing none and next I run npm run concat to generate the output file.

tmp dev
  • 8,043
  • 16
  • 53
  • 108
  • Same problem. Did you ever figure this out? It's like it uses the internal name. In my case I'm trying to export one component as a custom element from a sub-project. I feel like it must be some problem with my module. – Roobot Feb 13 '21 at 01:15
  • Nevermind. My issue was ultimately something else that broke when I moved my component to a sub-project. I should have tested the sub-project first before trying to make one of its components a custom element. – Roobot Feb 15 '21 at 22:30

0 Answers0