in packages/ng/ng-application/src/index.component.ts [42:86]
public ngAfterViewInit() {
this.addThingToDo('mount', async () => {
const { manifest, id, url, externalsVars, singleton = true } = this;
let sandBox = this.sandBox;
if (sandBox) {
sandBox.externalsVars = externalsVars;
sandBox.singleton = singleton;
} else {
sandBox = { singleton };
}
let domElement;
if (this.el) {
domElement = this.el
} else {
this.createdDomElement = domElement = document.createElement(id)
this.elementRef.nativeElement.appendChild(domElement)
}
if (externalsVars) {
// @ts-ignore
sandBox.externalsVars = externalsVars;
}
const appInfo = {
url,
id,
name: id,
manifest,
dom: domElement,
customProps: {
...getParcelProps(this)
}
};
this.app = await createMicroApp(appInfo, {
sandbox: sandBox
});
await load(this.app);
await mount(this.app, appInfo);
this.loading = false;
this.parcelDidMount && this.parcelDidMount();
})
}