forked from angular/components
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchips-input-example.html
More file actions
28 lines (28 loc) · 952 Bytes
/
chips-input-example.html
File metadata and controls
28 lines (28 loc) · 952 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<mat-form-field class="example-chip-list">
<mat-label>Favorite Fruits</mat-label>
<mat-chip-grid #chipGrid aria-label="Enter fruits">
@for (fruit of fruits(); track fruit) {
<mat-chip-row
(removed)="remove(fruit)"
[editable]="true"
(edited)="edit(fruit, $event)"
[aria-description]="'press enter to edit ' + fruit.name"
>
<button matChipEdit [attr.aria-label]="'edit ' + fruit.name">
<mat-icon>edit</mat-icon>
</button>
{{fruit.name}}
<button matChipRemove [attr.aria-label]="'remove ' + fruit.name">
<mat-icon>cancel</mat-icon>
</button>
</mat-chip-row>
}
<input
placeholder="New fruit..."
[matChipInputFor]="chipGrid"
[matChipInputSeparatorKeyCodes]="separatorKeysCodes"
[matChipInputAddOnBlur]="addOnBlur"
(matChipInputTokenEnd)="add($event)"
/>
</mat-chip-grid>
</mat-form-field>