I've encountered a problem with the ng-repeat
in my HTML code:
<div ng-repeat="a in items">
<div>
<span>{{a.name}}</span>
</div>
<div>
<select ng-model="a.c_id" ng-options="d.c_id as d.description for d in loclist" ng-disabled="display" ng-change="selected(a.c_id)">
</select>
</div>
In my controller, I have the following code:
$scope.display = false;
$scope.selected = function (value) {
$scope.te = value;
if ($scope.te == 3) {
$scope.display = true;
}
};
The issue I'm facing is that changing the selection in one dropdown is affecting all other dropdowns. The desired behavior is to only disable or enable the dropdown that was changed. How can I modify this code to achieve the intended functionality?