import {MatChipsModule} from '@angular/material/chips';
MatChipList
A material design chips component (named ChipList for its similarity to the List component).
Selector: mat-chip-list
Exported as: matChipListName | Description |
---|---|
@Input('aria-orientation')
|
Orientation of the chip list. |
@Input()
|
A 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()
|
An object used to control when error messages are shown. |
@Input()
|
Whether the user should be allowed to select multiple chips. |
@Input()
|
Whether or not this chip list is selectable. When a chip list is not selectable, the selected states for all the chips inside the chip list are always ignored. |
@Output()
|
Event emitted when the selected chip list 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. |
|
Combined stream of all of the child chips' blur change events. |
|
Combined stream of all of the child chips' focus change events. |
|
Combined stream of all of the child chips' remove change events. |
|
Combined stream of all of the child chips' selection change events. |
|
The chip components contained within this chip list. |
|
Whether the control is in an error state. |
|
Whether any chips or the matChipInput inside of this chip-list has focus. |
|
The ARIA role applied to the chip list. |
|
The array of selected chips inside chip list. |
|
Stream that emits whenever the state of the control changes such that the parent |
focus | |
---|---|
Focuses the first non-disabled chip in this chip list, or the associated input when there are no eligible chips. |
registerInput | |
---|---|
Associates an HTML input element with this chip list. |
|
Parameters | |
inputElement MatChipTextControl
|
|
updateErrorState |
---|
MatChip
Material design styled Chip component. Used inside the MatChipList component.
Selector: mat-basic-chip [mat-basic-chip] mat-chip [mat-chip]
Exported as: matChipName | Description |
---|---|
@Input()
|
Theme color palette for the component. |
@Input()
|
Whether ripples are disabled. |
@Input()
|
Whether the component is disabled. |
@Input()
|
Determines whether or not the chip displays the remove styling and emits (removed) events. |
@Input()
|
Whether or not the chip is selectable. When a chip is not selectable, changes to its selected state are always ignored. By default a chip is selectable, and it becomes non-selectable if its parent chip list is not selectable. |
@Input()
|
Whether the chip is selected. |
@Input()
|
The value of the chip. Defaults to the content inside |
@Output()
|
Emitted when the chip is destroyed. |
@Output()
|
Emitted when a chip is to be removed. |
@Output()
|
Emitted when the chip is selected or deselected. |
|
The ARIA selected applied to the chip. |
|
The chip avatar |
|
Whether the chip list is selectable |
|
The chip's remove toggler. |
|
The chip's trailing icon. |
deselect | |
---|---|
Deselects the chip. |
focus | |
---|---|
Allows for programmatic focusing of the chip. |
remove | |
---|---|
Allows for programmatic removal of the chip. Called by the MatChipList when the DELETE or BACKSPACE keys are pressed. Informs any listeners of the removal request. Does not remove the chip from the DOM. |
select | |
---|---|
Selects the chip. |
selectViaInteraction | |
---|---|
Select this chip and emit selected event |
toggleSelected | |
---|---|
Toggles the current selected state of this chip. |
|
Parameters | |
isUserInput boolean = false
|
|
Returns | |
boolean
|
|
MatChipRemove
Applies proper (click) support and adds styling for use with the Material Design "cancel" icon available at https://material.io/icons/#ic_cancel.
Example:
`<mat-chip>
<mat-icon matChipRemove>cancel</mat-icon>
</mat-chip>`
You may use a custom icon, but you may need to override the mat-chip-remove
positioning
styles to properly center the icon within the chip.
Selector: [matChipRemove]
MatChipInput
Directive that adds chip-specific behaviors to an input element inside <mat-form-field>
.
May be placed inside or outside of an <mat-chip-list>
.
Selector: input[matChipInputFor]
Exported as: matChipInput, matChipInputForName | Description |
---|---|
@Input('matChipInputAddOnBlur')
|
Whether or not the chipEnd event will be emitted when the input is blurred. |
@Input('matChipInputFor')
|
Register input for chip list |
@Input()
|
Whether the input is disabled. |
@Input()
|
Unique id for the input. |
@Input()
|
The input's placeholder text. |
@Input('matChipInputSeparatorKeyCodes')
|
The list of key codes that will trigger a chipEnd event. Defaults to |
@Output('matChipInputTokenEnd')
|
Emitted when a chip is to be added. |
|
Whether the input is empty. |
|
Whether the control is focused. |
focus | |
---|---|
Focuses the input. |
MatChipListChange
Change event object that is emitted when the chip list value has changed.
Name | Description |
---|---|
|
Chip list that emitted the event. |
|
Value of the chip list when the event was emitted. |
MatChipSelectionChange
Event object emitted by MatChip when selected or deselected.
Name | Description |
---|---|
|
Whether the selection change was a result of a user interaction. |
|
Whether the chip that emitted the event is selected. |
|
Reference to the chip that emitted the event. |
MatChipEvent
Represents an event fired on an individual mat-chip
.
Name | Description |
---|---|
|
The chip the event was fired on. |
MatChipInputEvent
Represents an input event on a matChipInput
.
Name | Description |
---|---|
|
The native |
|
The value of the input. |
MatChipsDefaultOptions
Default options, for the chips module, that can be overridden.
Name | Description |
---|---|
|
The list of key codes that will trigger a chipEnd event. |
MAT_CHIPS_DEFAULT_OPTIONS
Injection token to be used to override the default options for the chips module.
const MAT_CHIPS_DEFAULT_OPTIONS: InjectionToken<MatChipsDefaultOptions>;