Skip to content

Instantly share code, notes, and snippets.

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