Skip to content
This repository has been archived by the owner on Aug 22, 2022. It is now read-only.

Trouble getting scroll event #4

Open
sodacrackers opened this issue Sep 18, 2014 · 3 comments
Open

Trouble getting scroll event #4

sodacrackers opened this issue Sep 18, 2014 · 3 comments

Comments

@sodacrackers
Copy link

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" >

@lorenzofox3
Copy link
Owner

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.

@orszaczky
Copy link

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: #5

@awdyson
Copy link

awdyson commented Oct 2, 2014

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants