DEV Community

DAVID Stéphane
DAVID Stéphane

Posted on

Add dynamically web components from tag and url

Hello,

I want to implement a micro frontends architecture using:

  • micro frontends mostly coded in angular 13 built as web-components
  • a shell app in angular 13
  • expose the web components using a CDN

So in my shell app I want to insert dynamically (so with some kind of lazy loading) my web components when I need.

My approach to insert the components with something using document.createElement does not work as I expected so, I would like

viewContainerRef.createComponent<>(component)
But all I have for my component are:

How to proceed, I'm a little bit lost?

Top comments (1)

Collapse
 
dannyengelman profile image
Danny Engelman

Dev.To is a blog platform, for you to express your knowledge. It is not a support platform.
Try StackOverflow.com, but be aware these type of questions "Can you do my job" will be closed there. StackOverflow.com is where you post what you tried yourself, then you get help.