import { Component, Input, forwardRef } from '@angular/core'
import { NG_VALUE_ACCESSOR, ControlValueAccessor } from '@angular/forms'
-export type SelectOptionsItem = { id: number | string, label: string, description?: string }
+export type SelectOptionsItem = {
+ id: string | number
+ label: string
+ description?: string
+ group?: string
+ groupLabel?: string
+}
@Component({
selector: 'my-select-options',
@Input() items: SelectOptionsItem[] = []
@Input() clearable = false
@Input() searchable = false
- @Input() bindValue = 'id'
@Input() groupBy: string
selectedId: number | string
- // ng-select options
- bindLabel = 'label'
-
propagateChange = (_: any) => { /* empty */ }
writeValue (id: number | string) {