Inside one of my directives, I use angular.element($window).bind(\'scroll\'). When the directive is destroyed, I then want to unbind it. Normally,
angular.element($window).bind(\'scroll\')
unbind
bind:
$window.onscroll = function() { //your code };
unbind:
$scope.$on('$destroy', function () { $window.onscroll = undefined; });