I want to dynamically change select item of a dropdown list control using Angular JS, but it does not change the view. I tried this one but no result yet!
Controller:
$scope.dischargeType = {id:0,title:''};
$scope.setSelect = function() {
debugger;
$scope.dischargeType = $scope.dischargeTypes[1];
alert($scope.dischargeType.title);
// it shows that the $scope.operationType get the value,but no changes on html
}
View:
<label class="col-sm-3 control-label">Discharge Type</label>
<div class="col-sm-9">
<select ui-select2 data-ng-model="dischargeType" id="add-dischargeType" name="dischargeType">
<option data-ng-repeat="item in dischargeTypes" value="{{item.id}}">{{item.title}}</option>
</select>
</div>
Thank you indeed.