sroze / ngInfiniteScroll

Infinite Scrolling for AngularJS
http://sroze.github.com/ngInfiniteScroll/
MIT License
2.89k stars 723 forks source link

infinte-scroll not triggering when container is unbinded and then rebinded #387

Open shichung630 opened 4 years ago

shichung630 commented 4 years ago

Whenever there is a model change inside the container that infinite-scroll is in, it triggers a digest cycle to redraw the components with the updated model. When the components are redrawn, the infinite scroll container is unbinded to the scroll handler upon destruction. Then when it is re-created, the container is binded back with the scroll handler. When this happens, infinite-scroll does not trigger.

There is a stack-overflow for the non-angular version of ngInfinteScroll, but I can't figure out the solution for this library. Here is the stackoverflow link... https://stackoverflow.com/questions/7936270/jquery-infinite-scroll-reset