Skip to content

SiSelectGroupTemplateDirective documentation

import { SiSelectGroupTemplateDirective } from '@siemens/element-ng/select';

The directive allows to template/customize the group option rendering. This requires using the SiSelectSimpleOptionsDirective to specify options as input.

Example:

<si-select [options]="[
  { type: 'group', key: 'g1', label: 'Group 1', options: [
    { type: 'option', value: 'g1.i1', label: 'Item 1' },
    { type: 'option', value: 'g1.i2', label: 'Item 2' }
  ]},
  { type: 'group', key: 'g2', label: 'Group 2', options: [
    { type: 'option', value: 'g2.i1', label: 'Item 1' }
  ]}
]">
  <ng-template siSelectGroupTemplate let-group>{{ group.key | uppercase }}</ng-template>
</si-select>

Except where otherwise noted, content on this site is licensed under MIT License.