Hier ist mein Code. Ich habe eckige UI-Auswahl verwendet. Es funktioniert großartig. Aber jetzt hat sich die Anforderung geändert, dass das Dropdown nur einmal ausgewählt wird. Ich habe Limit-Attribut verwendet, aber es funktioniert nicht.ui-Select mit einzelner Auswahl (Limit-Attribut funktioniert nicht)
<span id="oCountriesSpan" ng-class="{'has-error': noCountriesSelected()}">
<ui-select multiple limit="1" ng-model="countryModel.selectedCountries" ng-disabled="isReadOnly" theme="bootstrap">
<ui-select-match placeholder="Select ..." allow-clear="true">{{$item.name}}
</ui-select-match>
<ui-select-choices repeat="country.id as country in countryCodes | filter:$select.search">
{{ country.name }}
</ui-select-choices>
</ui-select>
</span>
Controller-Aktion-Code löschen gibt es eine andere Art und Weise zu Beschränken Sie die Auswahl auf nur einen? – tv3free