orizens / ngx-infinite-scroll

Infinite Scroll Directive for Angular
https://www.npmjs.com/package/ngx-infinite-scroll
MIT License
1.23k stars 223 forks source link

Scroll count #374

Closed robertnicjoo closed 3 years ago

robertnicjoo commented 3 years ago

Your issue may already be reported! Please search on the issue track before creating one.

Expected Behavior

Get amount of scrolls

Actual Behavior

Not sure how to count amount of scrolls

Possible Solution

Steps To Reproduce / Demo (if applicable)

[ ] Please share a stackblitz or plunkr demo reproducing this issue

On my scroll function I need to get how many times user scrolled the page (i.e) is first time, second time, etc. in numbers so I can call on my api url based on those numbers.

Any idea?

<div infiniteScroll (scrolled)="onScrollOpen()"></div>
onScrollOpen() {
  // scroll once
  // scroll twice
  // scroll ...
}

Context

Your Environment