Problem: My loadMore() method gets executed on every container\'s scroll.
Meaning: loa
I have solved my problem.
One of foundation properties that NIS (ngInfiniteScroll) measure, are $container
and $elem
$container
is the parent of the scrolled elements Element.$elem
is the Element that contain the scrolled elements.Example
<$container>
<$elem>
$elem>
$container>
What NIS is trying to do, is to calculate on each mouse scroll, if enabled, the relation between these two elements, and check if $elem
is taller than $container
, and then scroll down or not. (it also check other properties like - distance, immediate-check & disabled).
So this relation between this two fundamental elements, is crucial for the understanding & debugging of NIS.
So my problem was exactly that - The $container and $elem were equal at their height.
I had fixed css height values (100%) on both elements (mainly cause I read in the documentation that I must pass height), and by mistake I fixed $elem
which was totally wrong.
Secondly - infinite-scroll-distance
can cause this to happen as well.
If the value that you're setting is high (let's say 2), and your loadMore()
method don't populate enough items, even if you disable runtime of the method, than you will get infinite loadmore()
executions.