<md-chips>
is an input component for building lists of strings or objects. The list items are
displayed as 'chips'. This component can make use of an <input>
element or an
<md-autocomplete>
element.
Custom <md-chip-template>
template
A custom template may be provided to render the content of each chip. This is achieved by
specifying an <md-chip-template>
element as a child of <md-chips>
. Note: Any attributes on
<md-chip-template>
will be dropped as only the innerHTML is used for the chip template. The
variables $chip
and $index
are available in the scope of <md-chip-template>
, representing
the chip object and its index in the list of chips, respectively.
To override the chip delete control, include an element (ideally a button) with the attribute
md-chip-remove
. A click listener to remove the chip will be added automatically. The element
is also placed as a sibling to the chip content (on which there are also click listeners) to
avoid a nested ng-click situation.
<md-chip-edit>
template, show/hide the edit element on tap/click? double tap/double
click?
<md-chips>
elements.
Warning: This component is a WORK IN PROGRESS. If you use it now, it will probably break on you in the future.
Parameter | Type | Description |
---|---|---|
* ng-model
string object
|
string object |
A model to bind the list of items to |
* md-on-append
expression
|
expression |
An expression that when called expects you to return an object representation of the chip input string. |
placeholder
string
|
string |
Placeholder text that will be forwarded to the input. |
secondary-placeholder
string
|
string |
Placeholder text that will be forwarded to the input, displayed when there is at least on item in the list |
readonly
boolean
|
boolean |
Disables list manipulation (deleting or adding list items), hiding the input and delete buttons |
md-on-remove
expression
|
expression |
An expression which will be called when a chip has been removed. |
md-on-select
expression
|
expression |
An expression which will be called when a chip is selected. |
delete-hint
string
|
string |
A string read by screen readers instructing users that pressing the delete key will remove the chip. |
delete-button-label
string
|
string |
A label for the delete button. Also hidden and read by screen readers. |