You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
434 B
JavaScript
20 lines
434 B
JavaScript
panelApp.controller('PanelCtrl', function PanelCtrl($scope, appContext) {
|
|
|
|
// TODO: remove this (newVal === oldVal ?)
|
|
var first = true;
|
|
|
|
appContext.getDebug(function (result) {
|
|
$scope.enable = result;
|
|
|
|
$scope.$watch('enable', function (newVal, oldVal) {
|
|
// prevent refresh on initial pageload
|
|
if (first) {
|
|
first = false;
|
|
} else {
|
|
appContext.setDebug(newVal);
|
|
}
|
|
});
|
|
});
|
|
|
|
});
|