Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @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);
- }
- }
Add Comment
Please, Sign In to add comment