Last active
August 12, 2018 06:28
-
-
Save rjoydip-zz/8f71fbf462fb5487f3a0f53fc6f4ad72 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| app.directive('scrollToTop', function() { | |
| return { | |
| restrict: 'EA', | |
| scope: { setFn: '&' }, | |
| link: function(scope, elem, attrs, ctrl) { | |
| scope.$on('scroll', function(event) { | |
| elem[0].scrollTop = elem[0].scrollHeight; | |
| }) | |
| } | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment