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. |
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. |