I am working on a code where I am using ng-repeat to iterate over options. now I want to use ng-select to select some value with a given condition but as the AngularJS docs mention :
ngSelected does not interact with the select and ngModel directives, it only sets the selected attribute on the element. If you are using ngModel on the select, you should not use ngSelected on the options, as ngModel will set the select value and selected options.
but as the structure of the ng-repeat is like the given below:
<select name="selectedPerson" id="selectedPerson" class="form-control" ng-model="selectedPerson" >
<option value="-1">Select Person</option>
<option ng-repeat="name in nameList" value="{{name.id}}" >{{name.name}}</option>
</select>
I can not use ng-select in the select. Now I do not want to iterate over a long list and compare the value with the condition and then set it in ng-model. I think the problem may get solved with using ng-options, but what I still know about ng-model is that it set complete object in ng-model, which I do not want, as because of that I may need to change a large amount of code.