File

packages/components/eui-select/eui-select-option.directive.ts

Description

Marks <option> as dynamic, so Angular can be notified when options change. Supports object values via ngValue and synchronizes with readonly mode.

With ngValue for objects

Example :
<option euiOption [ngValue]="user" [label]="user.name">{{user.name}}</option>

With selected state

Example :
<option euiOption [selected]="isSelected" [value]="id">Label</option>

Notes

  • Automatically applied to option elements within euiSelect
  • Use ngValue for complex object binding
  • Label property updates option text dynamically

See EuiSelectControlValueAccessor

Extends

NgSelectOption

Implements

OnDestroy OnChanges AfterViewInit

Metadata

Index

Inputs
Accessors

Constructor

constructor()

Inputs

label
Type : string
ngValue
Type : any

Tracks the value bound to the option element. Unlike the value binding, ngValue supports binding to objects.

selected
Type : boolean

Accessors

ngValue
setngValue(value: any)

Tracks the value bound to the option element. Unlike the value binding, ngValue supports binding to objects.

Parameters :
Name Type Optional
value any No
Returns : void

results matching ""

    No results matching ""