I made a dropdown with AngularJs as follows
<ui-select ng-model="SelectedItem.LegalEntity"
theme="bootstrap"
reset-search-input="false"
style="width: 100%"
id="legalEntityId"
ng-disabled="disabled">
<ui-select-match placeholder="">{{$select.selected.Name}}</ui-select-match>
<ui-select-choices repeat="entity in legalEntities">
<div ng-bind-html="entity.Name | highlight: $select.search"></div>
</ui-select-choices>
</ui-select>
When the dropdown has only 1 item in the list, I want to block the dropdown and leave the first item already selected.
I can already block using ng-disable, but I could not load the page with the first dropdown item selected.