JavaScript Error - Milestone 6 - Gauge Visibility with JS


#1

There is an potential JS Error in the code used in the “Gauge Visibility with JavaScript.txt” file.

/** Toggle visibility of gauges by the elbow motor. */
$scope.elbowGauges = function() {
//Hide if already shown
if($scope.app.view.ArmInspection.wdg[“elbow-temperature-gauge”].visible){
$scope.app.view.ArmInspection.wdg[“elbow-temperature-gauge”].visible = false;
$scope.app.view.ArmInspection.wdg[“elbow-current-gauge”].visible = false;
$scope.app.view.ArmInspection.wdg[“elbow-runtime-gauge”].visible = false;
$scope.app.view.ArmInspection.wdg[“elbow-repair-button”].visible = false;
}
//Show if not already shown
else {
$scope.app.view.ArmInspection.wdg[“elbow-temperature-gauge”].visible = true;
$scope.app.view.ArmInspection.wdg[“elbow-current-gauge”].visible = true;
$scope.app.view.ArmInspection.wdg[“elbow-runtime-gauge”].visible = true;
//Only show service button if shoulder needs service
if($scope.app.params.serviceElbow){
$scope.app.view.Arm_Inspection.wdg[“elbow-repair-gauge”].visible = true;
// the line above should be
// $scope.app.view.Arm_Inspection.wdg[“elbow-repair-button”].visible = true;

}; // <= Semicolon here is not needed
}
}