Search code examples
angularangular-cliangular-cli-v6angular-elements

Is it possible to add Angular Elements to existing Angular-6/CLI project?


I have an existing Angular 6 project and we would want to build an Angular element as a child of the main app module.

Is that possible?

I tried adding a new custom component and using createCustomElement to register. However, since it is a child component and not in the app.component.ts' selector tag, it is never picked up. The build files do not have any reference of the new custom element created.

Has Angular community extended this feature?


Solution

  • I do not see a way for Angular to support this, where one of the child components can be exported as a custom element and used in other projects.