Md-virtual-repeater using corpus as container

I am planning on using Angular Material virtual repeat to achieve a Facebook feature like a feature where posts scroll infinitely.

Is it possible to have a virtual repeat container in the body tag of an HTML document?

I don't see how this would work. I have different routes in my SPA application, I will need to add / remove a repeating virtual container on the body dynamically depending on whether the page uses infinite scrolling or not ...

What's a viable strategy for implementing md-virtual-repeat in order for the HTML body to be a scroll container?

I have not come across examples that put a container on a body element.

Any help would be appreciated.

+1


source to share


1 answer


After some tinkering, I found the answer.

The answer is actually very simple, if you are using Angular Material, stick to Angular Material.



I have used all layouts (i.e. container, nav, sidenav), I found that Angular Material does not use the browser body for scrolling anyway. All content is contained in the element container

. Just put it md-virtual-repeat-viewport

there and you're good to go!

0


source







All Articles