Guest User

Untitled

a guest
Feb 22nd, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. @Component({
  2. selector: 'grid-cell',
  3. template: ''
  4. })
  5. export class Cell implements OnInit {
  6. @Input() componentType: any;
  7. constructor(private viewContainerRef: ViewContainerRef,
  8. private cfr: ComponentFactoryResolver) {
  9. }
  10. ngOnInit() {
  11. let compFactory = this.cfr.resolveComponentFactory(this.componentType);
  12. this.viewContainerRef.createComponent(compFactory);
  13. }
  14. }
Add Comment
Please, Sign In to add comment