Skip to content

Commit 14f0237

Browse files
Moved selection logic into MatChipOption, MatChipList components
1 parent b580d1f commit 14f0237

File tree

5 files changed

+305
-141
lines changed

5 files changed

+305
-141
lines changed

src/dev-app/mdc-chips/mdc-chips-demo.html

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,14 @@ <h4>Unstyled</h4>
2121

2222
<h4>Advanced</h4>
2323

24-
<mat-chip-set selectable="false">
25-
<mat-chip color="accent" selected="true">Selected/Colored</mat-chip>
26-
27-
<mat-chip color="warn" selected="true" *ngIf="visible"
28-
(destroyed)="displayMessage('chip destroyed')" (removed)="toggleVisible()">
24+
<mat-chip-list multiple="true">
25+
<mat-chip-option color="accent" selected="true">Selected/Colored</mat-chip-option>
26+
<mat-chip-option color="warn" selected="true" *ngIf="visible"
27+
(destroyed)="displayMessage('chip destroyed')" (removed)="toggleVisible()">
2928
With Events
3029
<mat-icon matChipRemove>cancel</mat-icon>
31-
</mat-chip>
32-
</mat-chip-set>
30+
</mat-chip-option>
31+
</mat-chip-list>
3332
<div>{{message}}</div>
3433

3534
<h4>With avatar and icons</h4>
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<div #mdcChipSet
2-
class="mdc-chip-set"
3-
[class.mdc-chip-set--choice]="selectable && !multiple"
4-
[class.mdc-chip-set--filter]="selectable && multiple">
2+
class="mdc-chip-set"
3+
[ngClass]="_mdcClasses">
54
<ng-content></ng-content>
65
</div>
76

0 commit comments

Comments
 (0)