src/dropdown/list-item.interface.ts
A generic structure that represents an item in a list. A list item may contain additional lists with sub-items to represent a tree.
Example :export interface ListItem {
content: string;
selected: boolean;
disabled?: boolean;
items?: ListItem[];
}
content
and selected
are the only required properties you must provide.
When using a custom item template (supported by all the Carbon-Angular item views, not required by AbstractDropdownView)
the entire ListItem will be passed to the template as item
.
Properties |
[x: string]:
|
Defined in src/dropdown/list-item.interface.ts:35
|
Allows for any other custom properties to be included in the ListItem |
content |
content:
|
Type : string
|
Content to be displayed in the list. |
disabled |
disabled:
|
Type : boolean
|
Optional |
If the item is in a disabled state. (Note: not all lists have to support disabled states, and not all lists behave the same with disabled items) |
items |
items:
|
Type : ListItem[]
|
Optional |
Optional nested items. |
selected |
selected:
|
Type : boolean
|
Flag for the selected state of the item. |
export interface ListItem {
/**
* Content to be displayed in the list.
*/
content: string;
/**
* Flag for the selected state of the item.
*/
selected: boolean;
/**
* If the item is in a disabled state.
* (Note: not all lists have to support disabled states, and not all lists behave the same with disabled items)
*/
disabled?: boolean;
/**
* Optional nested items.
*/
items?: ListItem[];
/**
* Allows for any other custom properties to be included in the ListItem
*/
[x: string]: any;
}