Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Example for Stepan Suvorov Blog
platformBrowserDynamic().bootstrapModule(AppModule).then((ngModuleRef: NgModuleRef<AppModule>) => {
let appRef: ApplicationRef = ngModuleRef.injector.get(ApplicationRef);
let componentFactoryResolver = ngModuleRef.componentFactoryResolver;
setTimeout(() => {
let componentFactory = ngModuleRef.componentFactoryResolver.resolveComponentFactory(HelloComponent);
let componentRef = componentFactory.create(ngModuleRef.injector, [], document.querySelector('hello'));
}, 5000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment