So I'm encountering an issue where running a function and assigning variables to the data seems to be updating my global every time. I've double-checked my code, but I can't seem to pinpoint where the update to the global is coming from. Am I overlooking something?
var newInputs = $scope.configurationMap['RDY2000'].configuration.inputs.universalOffsets;
$scope.rdyInputs = function(){
var input = [];
for (var x = 0; x < newInputs.length; x++) {
if (newInputs[x].sensorType) {
input.push(newInputs[x])
}
}
return input
}
if($scope.data.property = 'rdy2000'){
$scope.inputs = $scope.rdyInputs($scope.data);
var Test = configUtilService.getOnlyCts(inputsKeyList)
var counter = Test.length + 1;
var tether = $scope.originalData.tether[0];
for (var x = 0; x < $scope.inputs.length; x++) {
$scope.data.inputs[x] = $scope.inputs[x]
$scope.data.inputs[x].key = 'CT' + counter;
$scope.data.inputs[x].type = 'ct';
$scope.data.inputs[x].description = tether + $scope.inputs[x].description;
counter++;
}
}