Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit 6b52c4d

Browse files
author
vikasrohit
committed
Merge pull request #585 from appirio-tech/feature/sup-2757-tc-sticky-remove-scroll-event-listener
SUP-2757, Remove scroll listener for tc-sticky directive to avoid memory leak
2 parents 5a40dab + c2abe4c commit 6b52c4d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

app/directives/tc-sticky/tc-sticky.directive.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@
4747
}
4848
}
4949
});
50+
// remove the event listener before destroying the directive
51+
scope.$on('$destroy',function() {
52+
angular.element($window).unbind("scroll");
53+
});
5054
}
5155
};
5256
}

0 commit comments

Comments
 (0)