Created
March 15, 2020 18:02
-
-
Save coderkan/fe06d523b03511a0bc8480c445c73c65 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
loadDynamicComponentsWithIndex(ind: any) { | |
const frameworkItem = this.frameworks[ind]; | |
const componentFactory = this.componentFactoryResolver.resolveComponentFactory(frameworkItem.component); | |
const viewContainerRef = this.frameworkHost.viewContainerRef; | |
viewContainerRef.clear(); | |
const componentRef = viewContainerRef.createComponent(componentFactory); | |
(<FrameworkComponent>componentRef.instance).data = frameworkItem.data; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment