Skip to content

Commit cfdfdf7

Browse files
committed
Fix leaking listeners and DOM elements.
1 parent bb1c33e commit cfdfdf7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Diff for: src/js/datetimepicker.js

+6
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,12 @@
433433
scope.changeView(configuration.startView, new DateObject({utcDateValue: getUTCTime(ngModelController.$viewValue)}));
434434
};
435435

436+
scope.$on('$destroy', function(){
437+
dataFactory = null;
438+
scope.changeView = null;
439+
});
440+
441+
436442
if (configuration.configureOn) {
437443
scope.$on(configuration.configureOn, function () {
438444
configuration = configure();

0 commit comments

Comments
 (0)