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

Commit c2abe4c

Browse files
author
vikasrohit
committed
SUP-2757, Remove scroll listener for tc-sticky directive to avoid memory leak
-- Removed event listener
1 parent d0e9eb9 commit c2abe4c

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)