import {MatAutocompleteModule} from '@angular/material/autocomplete';
MatAutocomplete
Selector: mat-autocomplete
Exported as: matAutocompleteName | Description |
---|---|
@Input()
|
Whether the first option should be highlighted when the autocomplete panel is opened.
Can be configured globally through the |
@Input('class')
|
Takes classes set on the host mat-autocomplete element and applies them to the panel inside the overlay container to allow for easy styling. |
@Input()
|
Whether ripples are disabled. |
@Input()
|
Function that maps an option's control value to its display value in the trigger. |
@Input()
|
Specify the width of the autocomplete panel. Can be any CSS sizing value, otherwise it will match the width of its host. |
@Output()
|
Event that is emitted when the autocomplete panel is closed. |
@Output()
|
Event that is emitted when the autocomplete panel is opened. |
@Output()
|
Event that is emitted whenever an option from the list is selected. |
|
Unique ID to be used by autocomplete trigger's "aria-owns" property. |
|
Whether the autocomplete panel is open. |
|
Element for the panel containing the autocomplete options. |
|
Whether the autocomplete panel should be visible, depending on option length. |
MatAutocompleteTrigger
Selector: input[matAutocomplete] textarea[matAutocomplete]
Exported as: matAutocompleteTriggerName | Description |
---|---|
@Input('matAutocomplete')
|
The autocomplete panel to be attached to this trigger. |
@Input('matAutocompleteDisabled')
|
Whether the autocomplete is disabled. When disabled, the element will act as a regular input and the user won't be able to open the panel. |
@Input('matAutocompleteConnectedTo')
|
Reference relative to which to position the autocomplete panel. Defaults to the autocomplete trigger element. |
|
The currently active option, coerced to MatOption type. |
|
Stream of autocomplete option selections. |
|
A stream of actions that should close the autocomplete panel, including when an option is selected, on blur, and when TAB is pressed. |
|
Whether or not the autocomplete panel is open. |
closePanel | |
---|---|
Closes the autocomplete suggestion panel. |
openPanel | |
---|---|
Opens the autocomplete suggestion panel. |
updatePosition | |
---|---|
Updates the position of the autocomplete suggestion panel to ensure that it fits all options within the viewport. |
MatAutocompleteOrigin
Directive applied to an element to make it usable as a connection point for an autocomplete panel.
Selector: [matAutocompleteOrigin]
Exported as: matAutocompleteOriginName | Description |
---|---|
|
Reference to the element on which the directive is applied. |
MatAutocompleteSelectedEvent
Event object that is emitted when an autocomplete option is selected.
Name | Description |
---|---|
|
Option that was selected. |
|
Reference to the autocomplete panel that emitted the event. |
MatAutocompleteDefaultOptions
Default mat-autocomplete
options that can be overridden.
Name | Description |
---|---|
|
Whether the first option should be highlighted when an autocomplete panel is opened. |
MAT_AUTOCOMPLETE_DEFAULT_OPTIONS
Injection token to be used to override the default options for mat-autocomplete
.
const MAT_AUTOCOMPLETE_DEFAULT_OPTIONS: InjectionToken<MatAutocompleteDefaultOptions>;
AUTOCOMPLETE_OPTION_HEIGHT
The height of each autocomplete option.
const AUTOCOMPLETE_OPTION_HEIGHT: 48;
AUTOCOMPLETE_PANEL_HEIGHT
The total height of the autocomplete panel.
const AUTOCOMPLETE_PANEL_HEIGHT: 256;
MAT_AUTOCOMPLETE_SCROLL_STRATEGY
Injection token that determines the scroll handling while the autocomplete panel is open.
const MAT_AUTOCOMPLETE_SCROLL_STRATEGY: InjectionToken<() => ScrollStrategy>;