I am currently working on a feature that involves displaying different data from a large object based on user selections made through a dropdown menu. The code snippet I am using to populate the data is as follows:
$scope.displayData = $scope.dataObj[$scope.selectedType][$scope.networkType];
The select options are linked to ng-model for user selection.
<select ng-model="networkType">
<option value="networkOne">One</option>
<option value="networkTwo">Two</option>
<option value="networkThree">Three</option>
</select>
<select ng-model="selectedType">
<option value="typeOne">One</option>
<option value="typeTwo">Two</option>
<option value="typeThree">Three</option>
</select>
Initially, both variables are initialized like this:
$scope.selectedType = 'individual';
$scope.networkType = 'inNetwork';
At first, the $scope.displayData displays the correct values. However, when the dropdown selections are changed, the displayData does not update to reflect the new data. I am trying to figure out what step I might have missed in this process.