Posts

Showing posts from April, 2023

Micro Frontend using Angular

Image
WHY MICRO APP? A whole angular application is bundled into a form that can simply be installed and used anywhere else. It can even be used in a plain html page like below:     <!DOCTYPE html>      <html>      <head>      <script src="https://cdn.jsdelivr.net/gh/Kavshree/micro-element-bundle/micro-header.js"></script>      </head>      <body> <micro-header></micro-header>      </body>      </html> CREATING A MICRO APP Let is start creating this app: Create an Angular app Ng new micro-header app.module.ts import { Injector , NgModule } from ' @angular/core '; import { BrowserModule } from ' @angular/platform-browser '; import { AppComponent } from ' ./app.component '; import { createCustomElement } from ' @angular/elements '; import { elementAt } from ' rxjs '; @ NgModule ({    de...