I'm also not sure how to dynamically add a viewchild. however, if the dynamic ViewContainerRef is what you want, you can try using this solution:
in the html file create:
<div id="test"></div>
in your create component:
let nodeElement = document.getElementById("test");
let compFactory = this.componentFactoryResolver.resolveComponentFactory(ChildComponent);
let component = compFactory.create(this.viewContainerRef.injector, null, nodeElement);
source
share