I want to dynamically append child components to parent component and have that components inside bootstrap grid system.
Following angular docs (https://angular.io/guide/dynamic-component-loader) I have created directive with ViewContainerRef and added element with that directive to parent template, then I added all the component with factory and ViewContainerRef createComponent().
Overall creating components works fine, but createComponent() method of ViewContainerRef does not give me a chance to actually wrap each created component in some angular elements, as it does not repeat the content, but just append the siblings.
What I want:
<div class="row">
    <div class="col">
       <app-mychild></app-mychild>
   </div>
</div>
<div class="row">
    <div class="col">
       <app-mychild></app-mychild>
   </div>
</div>
What I get if container is a child of grid div:
<div class="row">
    <div class="col">
       <app-mychild></app-mychild>
       <app-mychild></app-mychild>
       <app-mychild></app-mychild>
   </div>
</div>
What I get if child template starts with grid div:
<app-mychild>
    <div class="row">
        <div class="col">
        </div>
    </div>
</app-mychild>
<app-mychild>
    <div class="row">
        <div class="col">
        </div>
    </div>
</app-mychild>
UPD 12.04.19: greatly simplified the question
UPD-2 12.04.19: so I still did not find a solution, but made a workaround that more or less covers my needs, but looks kinda ugly - I've added bootstrap grid class right into component host element so it behaves like col/row, and now the result looks like:
<app-mychild class="row">
    <div class="col">
    </div>
</app-mychild>
 
    