2

I have found a number of tutorials for using the cdk-virtual-scroll-viewport, but there is one thing missing from every single tutorial I have found so far: how do I tell the viewport how many items are in my list?

I have implemented this using a BehaviorSubject for the datastream according to this tutorial and a few others, but I can't figure out any way to get it to load anything past the first 10 items that I initialize it with. The collectionViewer doesn't seem to care that I have more items than what I initialized it with, and neither it nor the BehaviorSubject have any members where I might be able to specify the length.

This seems like an extremely basic thing to be able to do (unless you're going for infinite scroll, but even then I don't see how you notify the viewport that there are more items yet to come), but aside from a few tutorials that tell me to initialize a 10,000 item array upfront (doesn't that defeat the purpose of loading items dynamically?), nobody seems to care about scrolling past the end of the previously fetched items.

What gives?

Trevortni
  • 688
  • 8
  • 23

0 Answers0