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
  • 10,934
  • 4
  • 49
  • 72
indra257
  • 282
  • 2
  • 18
  • 46

0 Answers0