ngInfiniteScroll - loadMore() method gets called on every mouse-scroll

前端 未结 7 1011
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-02 12:13

Solution below on the comments.

Problem: My loadMore() method gets executed on every container\'s scroll.

Meaning: loa

7条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-02 12:38

    I had similar problem, except that infinite scroll wouldn't even stop loading by the time I reached end of container (I used infinite-scroll-container option from v1.2). After long debug, I noticed that container height was float (634.245px for example), whereas internal element height was close to it, but int (635px for example) and it would trigger cycle over and over, because it thought that bottom limit was reached. The problem with ng-infinite-scroll is that its visual and it doesn't deal with actual data, so I had to check for returned data from backend and block it if results were empty (infinite-scroll-disabled related function).

提交回复
热议问题