lrInfiniteScroll icon indicating copy to clipboard operation
lrInfiniteScroll copied to clipboard

Trouble getting scroll event

Open sodacrackers opened this issue 9 years ago • 3 comments

module looks great- thank you. Having difficulty getting element.bind('scroll', function () { working. Module loads and line read; scrolling does not trigger function though. Can't get any element scrolling to trigger bound scroll function. Using: <div class="search-grid container-fluid" ng-class="{starred: currentSearch.starred}" lr-infinite-scroll="loadMore()" scroll scroll-threshold="200" time-threshold="200" >

sodacrackers avatar Sep 18 '14 06:09 sodacrackers

hello,

maybe scoping issue, your attribute scroll create an isolated scope ? Also, I have not tried with angular 1.3 release candidate, so you could try with 1.2.x.

If it does not work try to provide a plunker or any running example.

Thanks.

lorenzofox3 avatar Sep 18 '14 06:09 lorenzofox3

Not sure if we ran into the same issue.

In my tests handler always evaluated to noop, so the function never got called. To get it working without an isolate scope, I used $apply() directly in the promise timeout function, which $eval()s its argument against the scope.

I made a pull request with my solution: https://github.com/lorenzofox3/lrInfiniteScroll/pull/5

orszaczky avatar Oct 01 '14 06:10 orszaczky

The change @orszaczky proposed worked for me as well. Using angular 1.3 by the way.

awdyson avatar Oct 02 '14 19:10 awdyson