mtr / angular-iscroll

AngularJS module that enables iScroll 5 functionality, wrapping it in an easy-to-use directive.
MIT License
74 stars 27 forks source link

accessing events? #38

Closed iclimb513 closed 7 years ago

iclimb513 commented 8 years ago

I don't get it. I need something to happen when someone has scrolled to the end. What do you do?

None of these work:

`

` Someone please explain what you have to do to make use of the events? Also, I don't understand what use there is for this: iscroll-instance="instance" ok, now what? What use is that exactly? Can I look at that and access properties of it in the controller? Documentation tells me nothing. Not all of us are experts.
artaommahe commented 7 years ago

@iclimb513 just pass event handlers to directive property

<div iscroll="{ onScrollEnd: $ctrl.onScrollEnd }">

where $ctrl.onScrollEnd is controller public method

available events (dont forget to add on-prefix and capitalize first letter)

            'beforeScrollStart',
            'scrollCancel',
            'scrollStart',
            'scroll',
            'scrollEnd',
            'flick',
            'zoomStart',
            'zoomEnd'
mtr commented 7 years ago

Thanks for answering this, @artaommahe.