Merge pull request #1 from w33ble/fix/advanced-listener

unhook the change:config listener on destroy
This commit is contained in:
Court Ewing 2015-09-11 21:30:16 -04:00
commit 075a18e739

View file

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