Search code examples
javascriptjqueryangularjsecmascript-6nginfinitescroll

How to stop ng-infinite-scroll after loading complete data?


Here I am facing some problems while using ng-infinite-scroll. When I am ng-infinite-scroll-distance, it actually doesn't work. Moreover all data has been loaded but ng-infinite-scroll can't be disabled?

<div class="row-fluid" infinite-scroll-distance="2" infinite-scroll="self.loadMore(self.friendList)" > 

How can I make my infinite-scroll disable?


Solution

  • There's an infinite-scroll-disabled property that can be used in your div.

    <div class="row-fluid" infinite-scroll-distance="2" infinite-scroll="self.loadMore(self.friendList)" infinite-scroll-disabled="infiniteScrollStatus" >
    

    where infiniteScrollStatus could be a boolean value in your js that is set to true when you detect in your js that all your data has been loaded.