angular-bootstrap3-datepicker icon indicating copy to clipboard operation
angular-bootstrap3-datepicker copied to clipboard

Memory leaking

Open lpfeup opened this issue 10 years ago • 1 comments

I noticed that memory was leaking while switching back and forth between pages that included the datepicker. The DOM Node Count in Google Chrome kept going up.

I solved it by including the following snippet before returning from the link function:


    $scope.$on('$destroy', function() {
        if(input.data("DateTimePicker")) {
            input.data("DateTimePicker").destroy();
        }
        element.off("change.dp");
    });

lpfeup avatar Nov 09 '15 00:11 lpfeup

Hey great, can you provide a PR for this I'll be happy to merge it

benzen avatar Nov 09 '15 00:11 benzen