Skip to content

Memory leaking #18

@lpfeup

Description

@lpfeup

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");
    });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions