Having an issue where two drop down lists have the same value. When I set a value to the first drop down list, the second one also takes that value. Below is my code for reference:
<div class="col-md-6">
<div class="input-group bmargindiv1 col-md-12">
<span class="input-group-addon ndrftextwidth text-right" style="width:180px">Day Form :</span>
<select class="form-control" id="daysFrom" ng-model="daysFrom" ng-options="qua.name for qua in listOfDays track by qua.value ">
</select>
</div>
</div>
<div class="col-md-6">
<div class="input-group bmargindiv1 col-md-12">
<span class="input-group-addon ndrftextwidth text-right" style="width:180px">Day To :</span>
<select class="form-control" id="daysTo" ng-model="daysTo" ng-options="qu.name for qu in listOfDays track by qu.value ">
</select>
</div>
</div>
When setting the value for the first drop down menu like this:
$scope.daysFrom.value=2;
$scope.listOfDays=[{
name:'Select Day',
value:''
}]
$scope.daysFrom=$scope.listOfDays[0];
$scope.daysTo=$scope.listOfDays[0];
$http({
method:'GET',
url:"php/customerInfo.php?action=day",
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
}).then(function successCallback(response){
angular.forEach(response.data,function(obj){
var data={'name':obj.day_name,'value':obj.day_id};
$scope.listOfDays.push(data);
})
},function errorCallback(response) {
})
The second drop down list is also taking the same value, which is not intended. Need to assign different values to both drop down lists. Any assistance would be greatly appreciated.