Home > Mobile >  Infinite scroll for Angular 13.3.10
Infinite scroll for Angular 13.3.10

Time:01-18

I can't seem to find any infinite scroll libraries for Angular 13.3.10. Could someone please explain how I may make an infinite scroll that loads components rather than images?

I tried using ngx-infinite-scrol

CodePudding user response:

Use the Angular Material SDK. You could render a list and pass the item prop as input to a custom component to render that item.

<cdk-virtual-scroll-viewport itemSize="50" >
  <div *cdkVirtualFor="let item of items" >
    <custom-component [item]="item"></custom-component>
   </div>
</cdk-virtual-scroll-viewport>
  • Related