packages/eui/packages/components/eui-select/eui-select-multiple.directive.ts
The ControlValueAccessor
for writing multi-select control values and listening to multi-select
control changes. The value accessor is used by the FormControlDirective
, FormControlName
, and
NgModel
directives.
See EuiSelectControlValueAccessor
The follow example shows you how to use a multi-select control with a reactive form.
Example :const countryControl = new FormControl();
<select euiSelect multiple name="countries" [formControl]="countryControl">
<option euiOption *ngFor="let country of countries" [ngValue]="country">
{{ country.name }}
</option>
</select>
To customize the default option comparison algorithm, <select>
supports compareWith
input.
See the SelectControlValueAccessor
for usage.
SelectMultipleControlValueAccessor
ControlValueAccessor
DoCheck
Providers |
SELECT_MULTIPLE_VALUE_ACCESSOR
|
Selector | select[multiple][formControlName][euiSelect],select[multiple][formControl][euiSelect],select[multiple][ngModel][euiSelect] |
Properties |
Methods |
Inputs |
Accessors |
constructor()
|
isInvalid |
Type : boolean
|
_getOptionId | ||||||
_getOptionId(value: any)
|
||||||
Parameters :
Returns :
string | null
|
_getOptionValue | ||||||
_getOptionValue(valueString: string)
|
||||||
Parameters :
Returns :
any
|
_registerOption | ||||||
_registerOption(value: EuiSelectMultipleOption)
|
||||||
Parameters :
Returns :
string
|
registerOnChange | ||||||
registerOnChange(fn: (value: any) => void)
|
||||||
Registers a function called when the control value changes and writes an array of the selected options.
Parameters :
Returns :
void
|
registerOnTouched | ||||||
registerOnTouched(fn: any)
|
||||||
Parameters :
Returns :
void
|
writeValue | ||||||
writeValue(value: any)
|
||||||
Sets the "value" property on one or of more of the select's options.
Parameters :
Returns :
void
|
_idCounter |
Type : number
|
Default value : 0
|
_optionMap |
Type : Map<string | EuiSelectMultipleOption>
|
Default value : new Map<string, EuiSelectMultipleOption>()
|
value |
Type : any
|
The current value. |
isInvalid | ||||||
getisInvalid()
|
||||||
setisInvalid(state: BooleanInput)
|
||||||
Parameters :
Returns :
void
|