Skip to content
This repository has been archived by the owner on Mar 31, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1 from w33ble/fix/advanced-listener
Browse files Browse the repository at this point in the history
unhook the change:config listener on destroy
  • Loading branch information
epixa committed Sep 12, 2015
2 parents 5a4cadb + 34992c0 commit 075a18e
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
};
});
Expand Down

0 comments on commit 075a18e

Please sign in to comment.