Garmaine Staff asked 2 years ago

Suppose we package an Angular built web component created with @angular/elements and the Angular Package Format to NPM and we call it @ngx/my-custom-element.

It's used like this:


We now want to use this in another Angular project.

Assuming we do all the Web Component scaffolding that's required for Angular, can we then just import the component like this in app.component.ts:

import '@ngx/my-custom-element';

And use it in the Angular project within any component template like this:


This seems to be the case with the @vadeen library showcased in this article:

It seems like it should be possible. Just want to see if I'm missing anything before I attempt it.