-2

I am creating custom web components using Angular (14). It works fine in the Angular application. But when I am planning to use it in AngularJS, I need some help.

How can I use custom web components from microfronted into another? Are there any articles or sample example links which can guide me further?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
  • What exactly is your issue? Your question is kind of broad. Usually, web components are registered globally on your site. So if one microfrontend registers a webcomponent you can use it in every microfrontend – Lalaluka Sep 07 '22 at 07:25
  • @Lalaluka : To start over, i created a Microfrontend app using single-spa and have one app in angular and another in angularjs. I created web component using angular elements and able to use web component in angular application. But unable to see the web component when the single-spa uses angularjs code for displaying the application. So i was trying to figure out if there is a way for inter-communication among different micro-frontend app. I created a web component in angular – user9302609 Sep 07 '22 at 14:58
  • What is *"microfronted"*? – Peter Mortensen Aug 01 '23 at 18:44

1 Answers1

-1

I think you should be looking in to Webpack Module Federation. It helps one JavaScript application to use another easily. This concept is used commonly in angular micro front-ends.

Please read https://webpack.js.org/concepts/module-federation/

And go through this answer

https://stackoverflow.com/a/68908854/14673615

Hope this helps

Kelum Bandara
  • 443
  • 4
  • 9
  • This question is about web components in single-spa not microfrontends with module federation. – Lalaluka Sep 07 '22 at 07:21
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Sep 12 '22 at 06:43