Ion-scroll and on-scroll event


Hi there,
I am trying to get the on-scroll event with ion-scroll (with ionic 0.9.27):

<div class="photos"> <!-- has "controller: PhotosCtrl as photosctrl" in state definition -->

  <ion-content class="thumbscontainer" scroll="false">
    <div class="row">
      <div class="col col-bottom">
        <ion-scroll direction="x" class="thumbsscroller" on-scroll="photosctrl.checkImages()">
          <div class="thumbs" ng-repeat="thumb in thumbs" item="thumb">
            <img class="thumb" lazy-src="{{thumb}}" ng-click="photosctrl.selectImage(thumb)"/>

While the scrolling actually works as expected, the on-scroll event does not fire (The source code says

 * @ngdoc directive
 * @name ionScroll
 * @param {expression=} on-scroll Called whenever the user scrolls.


The only way I found is a bad hack:

<ion-scroll direction="x" class="thumbsscroller" onscroll="window.checkImages()">

using onscroll instead on-scroll with checkImages added to global window object as function.

How do I get on-scroll working?



It doesn’t actually seem to be implemented in the source code.

Here is my sample:

The source code never uses the onScroll attribute; so, I don’t think it will ever get called.

I’ve opened Issue # 865 :


So I will stick with my hack for the time being.



Wow. Andy is fast. He already fixed it. However, it’s only available in the nightlies.


Cool, thanks!
The change was small, so I could quickly add it locally into my ionic.bundle.js … and it works as expected.