4, 5], function (i) {
        $scope.$on('slide' + i, onSlideChange);
      });

      function onSlideChange($evt, active, locals) {
        $scope[$evt.name] = active;
      }
    });
    </script>
  </head>

  <body ng-controller="MainCtrl">
    <!-- fork me on github -->
    <a href="https://github.com/pc035860/angular-scroll-watch">
      <img style="position: fixed; top: 0; right: 0; border: 0; z-index: 100;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png" alt="Fork me on Git