Disabled options
Prevents selection of specific options via getOptionDisabled — here every third film is disabled. Disabled options are shown greyed out and skipped during keyboard navigation.
Overview
Examples
Usage
Import AutocompleteComponent and configure it with the inputs below. The full runnable source is on the Examples tab.
<autocomplete
[options]="films"
[(value)]="value"
[getOptionDisabled]="isEveryThird"
appearance="outline"
label="Movie" />API
This example demonstrates the inputs below. See the Autocomplete introduction for the complete API — every input, output, content template and filter helper.
Inputs
| Name | Type | Default | Description |
|---|---|---|---|
options | readonly T[] | — (required) | The list of options shown in the panel. |
value | T | T[] | null | null | Two-way selected value (model). An array when multiple. |
getOptionDisabled | (option: T) => boolean | () => false | Marks individual options as disabled. |
label | string | null | null | Field label (mat-label). |
