Hello! I am trying to pass the index into the when-visible directive so that I have alternating scroll effects.
Here is what I have working:
<div class="col s12 project not-visible animated" ng-repeat="project in projects track by $index" when-visible="animateElementIn" delay-percent="0.33">
</div>
...
$scope.animateElementIn = function($el) {
$el.removeClass('not-visible');
$el.addClass('fadeInLeftBig');
};
when-visible="animateElementIn($el, $index)"
...
$scope.animateElementIn = function($el, $index) {
$el.removeClass('not-visible');
$el.addClass('fadeInLeftBig');
};
is there a way to access the index (or odd/even) within the function called from where-visible?
Hello! I am trying to pass the index into the when-visible directive so that I have alternating scroll effects.
Here is what I have working:
I tried to pass both $el and $index in like this:
but I get this error:
is there a way to access the index (or odd/even) within the function called from where-visible?