import { InputNumberComponent } from '../input-number/input-number.component';
@Component({
selector: 'app-dynamic-form',
templateUrl: './dynamic-form.component.html',
styleUrls: ['./dynamic-form.component.scss']
})
export class DynamicFormComponent implements OnInit {
@ViewChild('ref', { read: ViewContainerRef }) vcRef: ViewContainerRef;
constructor(private resolver: ComponentFactoryResolver) { }
ngOnInit() {
const comp = this.resolver.resolveComponentFactory(InputNumberComponent)
this.vcRef.createComponent(comp)
}
}