twinssbc / Ionic-Calendar

A calendar directive for Ionic framework
http://twinssbc.github.io/Ionic-Calendar/demo
MIT License
159 stars 73 forks source link

$parent.$watch handler #114

Closed p-schuler closed 7 years ago

p-schuler commented 7 years ago

Hi

I think you should unregister the $parent.$watch handler on $destroy of your scope:

var wh = $scope.$parent.$watch($attrs.eventSource, function (value) {
            self.onEventSourceChanged(value);
        });

        $scope.$on('$destroy', function () {
            wh();
        });
twinssbc commented 7 years ago

@debugerr Good catch! I have fixed it in version 0.3.4. Thanks!