If I wanted to generate …

less than 1 minute read

If I wanted to generate a web component that can be used in an angular app would I generate an app, component or lib? There are schematics for all 3 in the Nrwl/web plugin.

https://nx.dev/angular/plugins/web/overview|https://nx.dev/angular/plugins/web/overview Nx Plugin for Web


There is also this guide that registers a custom element, is that the same as a web component?

<https://nx.dev/angular/examples/react-and-angular https://nx.dev/angular/examples/react-and-angular>

What I would like to do is create a web component from react but use it in an angular app (I’m currently using the Microsoft package angular-react but figured I could do it with just web components)

Go for library so you can publish the web component if you need to.

As per implementation, yes. You need to register the Custom Element in angular. https://angular.io/guide/elements