class TemplateComponent {
ref = opts.ref;
}
@NgModule({
imports: opts.imports,
declarations: [TemplateComponent]
})
class TemplateModule {}
const compiled = this.compiler.compileModuleAndAllComponentsSync(TemplateModule);
const factory = compiled.componentFactories.find((comp) =>
comp.componentType === TemplateComponent
);
opts.container.clear();
opts.container.createComponent(factory);
}
}