Created
February 9, 2018 15:05
-
-
Save petyosi/44fef6e1415cade0834adb32c4dba7db 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
@Component({ | |
selector: 'grid-cell', | |
template: '' | |
}) | |
export class Cell implements OnInit { | |
@Input() componentType: any; | |
constructor(private viewContainerRef: ViewContainerRef, | |
private cfr: ComponentFactoryResolver) { | |
} | |
ngOnInit() { | |
let compFactory = this.cfr.resolveComponentFactory(this.componentType); | |
this.viewContainerRef.createComponent(compFactory); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment