angular-leaflet-directive icon indicating copy to clipboard operation
angular-leaflet-directive copied to clipboard

Popup $destroy

Open matodrobec opened this issue 9 years ago • 2 comments

$destroy event is not triggered after the popup is closed.

app.directive('mapDetailPopup', function () {
    return {
        restrict: 'E',
        link: function (scope) {
            var timerId = null;

            timerId = setInterval(function () {
                console.log('interval');
            }, 2000);

            scope.$on('$destroy', function () {
                clearInterval(timerId);
                console.log('destroy');
            });
        }
    }
});

popup destroy example

Is there way how can I remove the timer?

matodrobec avatar Dec 13 '15 09:12 matodrobec

+1. It's a big problem ! Someone has a trick ?

I corrected it on ui-leaflet : Issue 240