import {MatSelectModule} from '@angular/material/select';
MatSelect
Selector: mat-select
Exported as: matSelectName | Description |
---|---|
@Input('aria-label')
|
Aria label of the select. |
@Input('aria-labelledby')
|
Input that can be used to specify the |
@Input()
|
Function to compare the option values with the selected values. The first argument is a value from an option. The second is a value from the selection. A boolean should be returned. |
@Input()
|
Whether to center the active option over the trigger. |
@Input()
|
Whether ripples are disabled. |
@Input()
|
Whether the component is disabled. |
@Input()
|
Object used to control when error messages are shown. |
@Input()
|
Unique id of the element. |
@Input()
|
Whether the user should be allowed to select multiple options. |
@Input()
|
Classes to be passed to the select panel. Supports the same syntax as |
@Input()
|
Placeholder to be shown if no value has been selected. |
@Input()
|
Whether the component is required. |
@Input()
|
Function used to sort the values in a select in multiple mode.
Follows the same logic as |
@Input()
|
Time to wait in milliseconds after the last keystroke before moving focus to an item. |
@Input()
|
Value of the select control. |
@Output()
|
Event emitted when the select panel has been toggled. |
@Output()
|
Event emitted when the selected value has been changed by the user. |
|
A name for this control that can be used by |
|
|
|
Tabindex to which to fall back to if no value is set. |
|
Whether the select has a value. |
|
Whether the component is in an error state. |
|
Whether the select is focused. |
|
|
|
|
|
Combined stream of all of the child options' change events. |
|
|
|
Panel containing the select options. |
|
Whether or not the overlay panel is open. |
|
The currently selected option. |
|
Emits whenever the component state changes. |
|
Trigger that opens the select. |
|
The value displayed in the trigger. |
close | |
---|---|
Closes the overlay panel and focuses the host element. |
focus | |
---|---|
Focuses the select element. |
|
Parameters | |
options? FocusOptions
|
|
open |
---|
toggle | |
---|---|
Toggles the overlay panel open or closed. |
updateErrorState | |
---|---|
Updates the error state based on the provided error state matcher. |
MatSelectTrigger
Allows the user to customize the trigger that is displayed when the select has a value.
Selector: mat-select-trigger
MatSelectChange
Change event object that is emitted when the select value has changed.
Name | Description |
---|---|
|
Reference to the select that emitted the change event. |
|
Current value of the select that emitted the event. |
MatSelectConfig
Object that can be used to configure the default options for the select module.
Name | Description |
---|---|
|
Whether option centering should be disabled. |
|
Class or list of classes to be applied to the menu's overlay panel. |
|
Time to wait in milliseconds after the last keystroke before moving focus to an item. |
MAT_SELECT_SCROLL_STRATEGY
Injection token that determines the scroll handling while a select is open.
const MAT_SELECT_SCROLL_STRATEGY: InjectionToken<() => ScrollStrategy>;
MAT_SELECT_CONFIG
Injection token that can be used to provide the default options the select module.
const MAT_SELECT_CONFIG: InjectionToken<MatSelectConfig>;
MAT_SELECT_TRIGGER
Injection token that can be used to reference instances of MatSelectTrigger
. It serves as
alternative token to the actual MatSelectTrigger
class which could cause unnecessary
retention of the class and its directive metadata.
const MAT_SELECT_TRIGGER: InjectionToken<MatSelectTrigger>;