@mashroom/mashroom-portal-demo-angular-app
v2.7.1
Published
A simple Angular based SPA that can be used in the Mashroom Portal
Downloads
124
Readme
Mashroom Portal Demo Angular App
Plugin for Mashroom Server, a Microfrontend Integration Platform.
This is a simple Angular based SPA which can be developed and run standalone, but can also act as a building block in the Mashroom Portal.
Usage
If node_modules/@mashroom is configured as plugin path just add @mashroom/mashroom-portal-demo-angular-app as dependency.
Then you can place it on any page via Portal Admin Toolbar.
Implementation hints
Angular was clearly designed for monolithic web applications that use the whole browser window. So, to make it more behave like a Microfrontend you have to change a few things in the template generated by the Angular CLI:
- Since you can register a NgModule only once, use a dummy main module that loads the actual app module (see loader.module.ts), otherwise you could not load the App multiple times with different configurations on the same page
- Remove all polyfills, since Microfrontends should not install global libraries
- Get rid of zone.js because it installs itself globally and might infer with other Apps