Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save martymarkenson/7cde62653589eecdc12fcfe3c6475e75 to your computer and use it in GitHub Desktop.
Save martymarkenson/7cde62653589eecdc12fcfe3c6475e75 to your computer and use it in GitHub Desktop.
$scope.$watch("view.wdg['currentGauge']['text']", function() {
if($scope.view.wdg['currentGauge']['text'] > 5) {
$scope.view.wdg['currentGauge']['src'] = 'app/resources/Uploaded/current_red.png';
}
else if($scope.view.wdg['currentGauge']['text'] > 1) {
$scope.view.wdg['currentGauge']['src'] = 'app/resources/Uploaded/current_green.png';
}
else{
$scope.view.wdg['currentGauge']['src'] = 'app/resources/Uploaded/current_yellow.png';
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment