import {MatSelectModule} from '@angular/material/select';
MatSelectTrigger
Allows the user to customize the trigger that is displayed when the select has a value.
Selector: mat-select-trigger
MatSelect
Selector: mat-select
Exported as: matSelectName | Description |
---|---|
@Input('aria-label')
|
Aria label of the select. If not specified, the placeholder will be used as label. |
@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()
|
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. |
|
Whether the input is currently in an autofilled state. If property is not present on the control it is assumed to be false. |
|
A name for this control that can be used by |
|
User-supplied override of the trigger element. |
|
Whether the select has a value. |
|
Whether the control is in an error state. |
|
Whether the select is focused. |
|
|
|
All of the defined groups of options. |
|
Combined stream of all of the child options' change events. |
|
All of the defined select options. |
|
Overlay pane containing the options. |
|
Panel containing the select options. |
|
Whether or not the overlay panel is open. |
|
The currently selected option. |
|
Stream that emits whenever the state of the control changes such that the parent |
|
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. |
open | |
---|---|
Opens the overlay panel. |
toggle | |
---|---|
Toggles the overlay panel open or closed. |
updateErrorState |
---|
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. |
SELECT_PANEL_MAX_HEIGHT
The max height of the select's overlay panel
const SELECT_PANEL_MAX_HEIGHT: 256;
SELECT_PANEL_PADDING_X
The panel's padding on the x-axis
const SELECT_PANEL_PADDING_X: 16;
SELECT_PANEL_INDENT_PADDING_X
The panel's x axis padding if it is indented (e.g. there is an option group).
const SELECT_PANEL_INDENT_PADDING_X: number;
SELECT_ITEM_HEIGHT_EM
The height of the select items in em
units.
const SELECT_ITEM_HEIGHT_EM: 3;
SELECT_MULTIPLE_PANEL_PADDING_X
Distance between the panel edge and the option text in multi-selection mode.
Calculated as: (SELECT_PANEL_PADDING_X * 1.5) + 20 = 44 The padding is multiplied by 1.5 because the checkbox's margin is half the padding. The checkbox width is 16px.
const SELECT_MULTIPLE_PANEL_PADDING_X: number;
SELECT_PANEL_VIEWPORT_PADDING
The select panel will only "fit" inside the viewport if it is positioned at this value or more away from the viewport boundary.
const SELECT_PANEL_VIEWPORT_PADDING: 8;
MAT_SELECT_SCROLL_STRATEGY
Injection token that determines the scroll handling while a select is open.
const MAT_SELECT_SCROLL_STRATEGY: InjectionToken<() => ScrollStrategy>;