using https://www.npmjs.com/package/ngx-infinite-scroll
Angular Infinite Scroll
import in the module
import { InfiniteScrollModule } from 'ngx-infinite-scroll';
imports: [
CommonModule,
RouterModule.forChild(routes),
HttpClientModule,
InfiniteScrollModule
]
-----ON HTML
<div
infiniteScroll
[infiniteScrollDistance]=".5"
[infiniteScrollThrottle]="1"
(scrolled)="onScroll()"
>
<div *ngFor="let u of imgUrl">
<app-imagedump [src]="u"></app-imagedump>
</div>
</div>
----on ts file some function which will change the imput vaues
for(let i=0;i<=id;i++){
this.imgUrl.push(this.url.replace('POKEMONID',this.start.toString()))
this.start = this.start+1;
}
}
onScroll(){
this.fetchList();
}