I am investigating Micro-Frontend possibilities with Angular. I am looking into the feasibility of having independently the different parts of the UI served by their own HTTP server process but composed dynamically on the main UI; which is merely a UI template with placeholders to be replaced by these dynamically loaded Micro-Frontends.
Currently we are using iframes for this and it works great apart from the extra resources required on the client browser and of course the not so dynamic and limited approach.
My question is if it is possible to have a component in an Angular App implementing a shared and well-known component interface, be loaded dynamically from another URL; subdomain in our case?
For example, we have the following domains:
- domain.com
- sub1.domain.com
- sub2.domain.com
and we have the following component available from sub1.domain.com:
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'sales-frontend',
templateUrl: './sales-frontend.component.html',
styleUrls: ['./sales-frontend.component.css']
})
export class SalesFrontEndComponent implements SharedInterface, OnInit {
constructor() { }
ngOnInit() {
}
}
is it possible to load it dynamically on the domain.com [main UI] from the sub1.domain.com?
Same goes for another component such as ProductsFrontEndComponent provided by the sub2.domain.com.
Thank you very much priory!