File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -160,6 +160,7 @@ <h4>Multi selection</h4>
160160
161161 < mat-checkbox [(ngModel)] ="disableInputs "> Disabled</ mat-checkbox >
162162 < mat-checkbox [(ngModel)] ="editable "> Editable</ mat-checkbox >
163+ < mat-checkbox [(ngModel)] ="peopleWithAvatar "> Show Avatar</ mat-checkbox >
163164 < mat-checkbox [(ngModel)] ="showEditIcon "> Show Edit Icon</ mat-checkbox >
164165 < mat-checkbox [(ngModel)] ="disabledInteractive "> Disabled Interactive</ mat-checkbox >
165166
@@ -178,6 +179,9 @@ <h4>Input is last child of chip grid</h4>
178179 < mat-icon > edit</ mat-icon >
179180 </ button >
180181 }
182+ @if (peopleWithAvatar && person.avatar) {
183+ < mat-icon matChipAvatar > {{person.avatar}}</ mat-icon >
184+ }
181185 {{person.name}}
182186 < button matChipRemove aria-label ="Remove contributor ">
183187 < mat-icon > close</ mat-icon >
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ import {MatIconModule} from '@angular/material/icon';
2020
2121export interface Person {
2222 name : string ;
23+ avatar ?: string ;
2324}
2425
2526export interface DemoColor {
@@ -52,6 +53,7 @@ export class ChipsDemo {
5253 listboxesWithAvatar = false ;
5354 disableInputs = false ;
5455 editable = false ;
56+ peopleWithAvatar = false ;
5557 showEditIcon = false ;
5658 disabledInteractive = false ;
5759 message = '' ;
@@ -76,12 +78,12 @@ export class ChipsDemo {
7678 selectedPeople = null ;
7779
7880 people : Person [ ] = [
79- { name : 'Kara' } ,
80- { name : 'Jeremy' } ,
81- { name : 'Topher' } ,
82- { name : 'Elad' } ,
83- { name : 'Kristiyan' } ,
84- { name : 'Paul' } ,
81+ { name : 'Kara' , avatar : 'K' } ,
82+ { name : 'Jeremy' , avatar : 'J' } ,
83+ { name : 'Topher' , avatar : 'T' } ,
84+ { name : 'Elad' , avatar : 'E' } ,
85+ { name : 'Kristiyan' , avatar : 'K' } ,
86+ { name : 'Paul' , avatar : 'P' } ,
8587 ] ;
8688
8789 availableColors : DemoColor [ ] = [
You can’t perform that action at this time.
0 commit comments