maxaon / angular-nanoscroller

Wrapper for nanoScrollerJS
MIT License
54 stars 39 forks source link

Support for scroller events #6

Open felipe-pereira opened 10 years ago

felipe-pereira commented 10 years ago

Hi, I'm using your wrapper and needed to bind some behavior to the scroll, in this case the 'scrollend' event (very useful to implement an infinite scroll).

To see how it worked in my solution I added this on the link of the directive;

if(attr.scrollend)
  element.bind('scrollend', function () {
    scope.$apply(attr.scrollend);
  });

and this on the html...

<scrollable scrollend="loadMyObjects()">

It worked like a charm.

Now that we are here, related to this particular event, there is a hack that causes this event to fire twice, maybe you could see if the hack is still needed.

Let me know what you think about this, thanks.

greuff commented 8 years ago

+1