Created
June 25, 2017 15:55
-
-
Save stevermeister/98820b3cd5c5ece59dabc963a172ec73 to your computer and use it in GitHub Desktop.
Example for Stepan Suvorov Blog
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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')); | |
appRef.attachView(componentRef.hostView); | |
}, 5000); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment