How to customize group label in Angular UI-Select

In Angular ui-select ( GitHub Link ), how can I customize the group label?

enter image description here

As the picture shows, the list is grouped by country, how can I customize the group label to make it larger than the selection items?

Plunger example

<ui-select ng-model="person.selected" theme="bootstrap" ng-disabled="disabled" style="min-width: 300px;" title="Choose a person">
<ui-select-match placeholder="Select a person in the list or search his name/age...">{{$select.selected.name}}</ui-select-match>
<ui-select-choices group-by="'country'" repeat="person in people | propsFilter: {name: $select.search, age: $select.search}">
  <div ng-bind-html="person.name | highlight: $select.search"></div>
  <small>
    email: {{person.email}}
    age: <span ng-bind-html="''+person.age | highlight: $select.search"></span>
  </small>
</ui-select-choices>
</ui-select>

Example modified from official example link .

Thanks in advance.

+4
source share
2 answers

I just targeted a CSS class that was bound to a group by label as follows:

.ui-select-choices-group-label {
  font-size: 20px;
}

You can see the updated Plunkr here

+4
source

, .

, , :

biggerGroup ui-select-choices, :

<ui-select-choices class="biggerGroup" group-by="'country'" repeat="person in people | propsFilter: {name: $select.search, age: $select.search}">

.css :

.biggerGroup > .ui-select-choices-group > .ui-select-choices-group-label {
    font-size: 20px;
}

, , biggerGroup .

, -.

0

Source: https://habr.com/ru/post/1618902/


All Articles