0

I have an application based on Angular (the shell), Webpacks Module Federation and web components (used to wrap the micro frontend application).

In my router configuration I have the following content:

const routes: Routes = [
  ....
  {
    matcher: startsWith('my-remote'),
    component: WebComponentWrapper,
    data: {
      remoteEntry: `http://localhost:4201/remoteEntry.js`,
      remoteName: 'myRemote',
      type: 'module',
      exposedModule: './App',
      elementName: 'my-remote',
    } as WebComponentWrapperOptions,
  },
  ....

Is there a way to add error handling if the referenced module or the needed remoteEntry.js could not be loaded?

Since we have a custom configuration I have to do it without loadChildren or loadRemoteModule where you could add a catch block.

Codehan25
  • 2,704
  • 10
  • 47
  • 94

0 Answers0