jqueryangularjsangular-uiangular-ui-select

ui-select with single select (limit attribute is not working)


Here is my code. I used angular UI-select. It is working great. But now, the requirement changed for the dropdown to be selected only once. I used limit attribute, but its not working.

<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>

Solution

  • Limit was introduced after 0.13 version. I was using 0.12