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

前端 未结 7 1034
佛祖请我去吃肉
佛祖请我去吃肉 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:36

    Without a Plunker to see the actual code I'll direct you right to the ngInfiniteScroll FAQ:

    Why is ngInfiniteScroll triggering my expression on every single scroll event?

    The infiniteScroll directive uses the height of the element that it's attached to in order to determine how close to the bottom of the window it is. In some cases, the browser can report a height of 0, which causes this behavior. Usually, this is due to a container element that only contains floated children. The simplest way to fix this problem is to add a "spacer" element to the bottom of the container (something like

    ); see this StackOverflow question and its associated answers for more details.

提交回复
热议问题