Created
May 3, 2016 05:19
-
-
Save searleb/902c00885daa93e0d386d49822e071e8 to your computer and use it in GitHub Desktop.
How to act detect the end of ng-repeat - useful for jQuery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Init slider with options | |
scope.$on('LastRepeaterElement', function(){ | |
// Do something | |
$slider.slick(slickOptions); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.directive('emitLastRepeaterElement', function() { | |
return function(scope) { | |
if (scope.$last){ | |
scope.$emit('LastRepeaterElement'); | |
} | |
}; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div ng-repeat="foo in bar" emit-last-repeater-element</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment