Does angular ui select (bootstrap version) optgroup support?

Does anyone know if Angular-UI-Select Bootstrap version is supported ? optgroup

Can't seem to find any documentation for this at ?

Here's an example:


How to add optgroup


In this example, let's say a group of people by country.


source to share

2 answers

You can use the group-by attribute .

See "Demo Multiselect" (last example "Array of objects (with groupBy)") at

This is a multi-selector demo, but group-by works for a single selection too.



This is a group - with a string


$scope.countries = [
                    "code": "AD",
                    "name": "Andorra",
                    "continent": "Europe"
                    "code": "AE",
                    "name": "United Arab Emirates",
                    "continent": "Asia"
                    "code": "AF",
                    "name": "Afghanistan",
                    "continent": "Asia"



    <ui-select ng-model="" style="min-width: 300px;">
        <ui-select-match placeholder="Select Country">
            <span ng-bind="$"></span>
        <ui-select-choices repeat="country in countries | filter: {name: $}" group-by="'continent'">
        <span ng-bind=""></span>


Generated JSON of all countries with their continent using



All Articles