Infinite scroll does not work with ion-slide with async data


#1

Hi community,
In my ion infinite scroll the data is not loading.But in the console the data is loading properly.
Can anybody help me on this? iam gettind 10 items on each API request.Passing pageno as paramter.This wasted my two days.Any suggestion is appreciable

public page_no=1;
this.productSer.getProductById(this.productid,this.page_no)
    .subscribe((res:any)=>{
      for(let data of res) {
       this.productcategory=data.content;
     }
},error=>{
})

doInfinite(ev){
  this.page_no+=1;
  this.productSer.getProductById(this.productid,this.page_no)
        .subscribe((res:any)=>{
           for(let product of data.content){
                let cat = new CategoryModel(product.catid,product.catname);
                this.getProducts(product.products,cat);
                this.category = [... this.category,cat]; 
        }
           ev.complete();
         }
             
          })
        
    };

Thanks in advance