0

I have a list of components for which data is fed by asynchronous calls. I am dynamically adding these components to an anchor point based on the row location. If I don't specify the row number, components are added to the view as soon as it gets the data.But I need them to follow based on the row location, which is not happening

switch{
case "grid":
    this.factory = this.componentFactoryResolver.resolveComponentFactory(GridComponent1);
    this.ref = this.coloneanchor.createComponent(component, rowLocation);
    this.ref.instance.gridData = this.favFilterData;
    this.ref.instance.gridTitle = gadget.Name;
    this.ref.changeDetectorRef.detectChanges();

case "donut":

  this.factory = this.componentFactoryResolver.resolveComponentFactory(donut);
    this.ref = this.coloneanchor.createComponent(component, rowLocation);
    this.ref.instance.gridData = this.favFilterData;
    this.ref.instance.gridTitle = gadget.Name;
    this.ref.changeDetectorRef.detectChanges();
}
Maciej Treder
  • 11,866
  • 5
  • 51
  • 74
indra257
  • 66
  • 3
  • 24
  • 50

0 Answers0