I have 2 different Angular apps [Product View and Product Cart] and a shell application. All 3 apps are hosted on different ports. In the shell application I have integrated above apps using module federation. Both apps perfectly work for different routes. Here is my shell app routing code:
const routes: Routes = [
{
path: '',
component: HomeComponent,
pathMatch: 'full',
},
{
path: 'abc',
loadChildren: () =>
loadRemoteModule({
remoteEntry: 'http://localhost:3000/remoteEntry.js',
remoteName: 'mfe1',
exposedModule: './Module',
}).then((m) => {
return m.MicrofrontendModule;
}),
},
{
path: 'remote1',
loadChildren: () =>
loadRemoteModule({
remoteEntry: 'http://localhost:7000/remoteEntry.js',
remoteName: 'mfe2',
exposedModule: './Module1',
}).then((m) => {
return m.Microfrontend1Module;
}),
},
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule],
})
export class AppRoutingModule {}
and my App componet html is looks like
<ul>
<li [routerLink]="['/remote']">Product View</li>
<li [routerLink]="['remote1']">Product Cart</li>
</ul>
<h2>
Shell App
</h2>
<div class="container">
<router-outlet></router-outlet>
</div>
Now I want to open both apps side by side in App component. Anyone kindly help me on this.