I have my Angular2 application with multiple dynamic components. I am able to create all these dynamic components and load them on to the page using ComponentFactoryResolver. But the problem is I want to dispaly them in row/column fashion. I know the row and column location of the dynamic component that I have created. so I should inject this component at that particular location, which I couldn't able to achieve.
I am creating the dynamic components as below. Here content is the anchor point. I am adding all my dynamic components to this content. So all the dynamically created components are displayed one below the other. But my requirement is to display all these dynamic components in row/column fashion. I know the row/column number of my dynamic component.
const factory = this.componentFactoryResolver.resolveComponentFactory(DonutComponent);
const ref = this.content.createComponent(factory);
ref.instance.donutchartData = this.donughtChartData;
ref.changeDetectorRef.detectChanges();