Skip to content

Commit

Permalink
unhook the change:config listener on destroy
Browse files Browse the repository at this point in the history
  • Loading branch information
w33ble committed Sep 12, 2015
1 parent 5a4cadb commit 34992c0
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 34992c0

Please sign in to comment.