Merge pull request #1 from w33ble/fix/advanced-listener
unhook the change:config listener on destroy
This commit is contained in:
commit
075a18e739
|
@ -42,8 +42,12 @@ define(function (require) {
|
|||
.value();
|
||||
}
|
||||
|
||||
// react to changes of the config values
|
||||
var unhook = $rootScope.$on('change:config', readConfigVals);
|
||||
$scope.$on('$destroy', unhook);
|
||||
|
||||
// initial config setup
|
||||
readConfigVals();
|
||||
$rootScope.$on('change:config', readConfigVals);
|
||||
}
|
||||
};
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue