Guest User

Untitled

a guest
Oct 18th, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. export default onScrollEnd
  2.  
  3. function onScrollEnd() {
  4. return {
  5. restrict: 'A',
  6. link: function (scope, element, attrs) {
  7. var raw = element[0];
  8. element.bind('scroll', function () {
  9. if (raw.scrollTop + raw.offsetHeight == raw.scrollHeight) {
  10. scope.$apply(attrs.onScrollEnd);
  11. }
  12. })
  13. }
  14. }
  15. }
Add Comment
Please, Sign In to add comment