I have this element that I\'m referencing by Id:
let infiniteScrollElement = document.getElementById(\'th-infinite-scroll-tracker\');
I
I am literally working on this now and found that this is the most versatile use case for "me."
As YASH DAVE mentioned, using a Host Listener is your best bet for an Angular 'onScroll' implementation. However, 'Window: Scroll' didn't work for my use case (a table injected within a Dashboard). So I had luck doing this
@HostListener('scroll', ['$event.target'])
onScroll(elem){
if(( elem.offsetHeight + elem.scrollTop) >= elem.scrollHeight) {
console.log("It's Lit");
}
}'
CSS:
:host {
display: block;
max-height: 700px;
width: 100%;
overflow-y: scroll;
scroll-behavior: auto;
}
Explanation:
Additionally, review This for an insight on offsetHeight, clientHeight, scrollHeight.