Overview
Micro-Frontend that are developed using Angular-Elements can be either of the two types below.
- Single Page or widget Micro-Frontend (Microapp-A)
- Multi Page Micro-Frontend (Microapp-B)
Problem Statement
In Micro-Frontend with multiple page, it is observed that the routing is not updated when Micro-Fronted is loaded again. For eg, in this sample application, there are five pages in the driver. Page-One, Page-Three and Page-Five load Microapp-A. Page-Two and Page-Four load Microapp-B. When Microapp-B is loaded again in Page-Four, the routes are not loaded properly.
Probable Cause
Micro-Frontend is not getting destroyed properly. Due to this, the routes are not getting re-initialized.
Is there a way to destroy Angular-elements properly ?
Repo URL to reproduce - https://github.com/pranesh229/micro-frontend-sample-angular-11