Skip to content

Commit

Permalink
docs(material/chips): use defaults for input bindings (#23688)
Browse files Browse the repository at this point in the history
Do not set the `selectable` and `removable` default values explicitly in the examples.
  • Loading branch information
bampakoa committed Dec 7, 2021
1 parent 8aef0b0 commit a4ffc5e
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
<mat-chip-list #chipList aria-label="Fruit selection">
<mat-chip
*ngFor="let fruit of fruits"
[selectable]="selectable"
[removable]="removable"
(removed)="remove(fruit)">
{{fruit}}
<button matChipRemove *ngIf="removable">
<button matChipRemove>
<mat-icon>cancel</mat-icon>
</button>
</mat-chip>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ import {map, startWith} from 'rxjs/operators';
styleUrls: ['chips-autocomplete-example.css'],
})
export class ChipsAutocompleteExample {
selectable = true;
removable = true;
separatorKeysCodes: number[] = [ENTER, COMMA];
fruitCtrl = new FormControl();
filteredFruits: Observable<string[]>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<mat-form-field class="example-chip-list" appearance="fill">
<mat-label>Favorite Fruits</mat-label>
<mat-chip-list #chipList aria-label="Fruit selection">
<mat-chip *ngFor="let fruit of fruits" [selectable]="selectable"
[removable]="removable" (removed)="remove(fruit)">
<mat-chip *ngFor="let fruit of fruits" (removed)="remove(fruit)">
{{fruit.name}}
<button matChipRemove *ngIf="removable">
<button matChipRemove>
<mat-icon>cancel</mat-icon>
</button>
</mat-chip>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ export interface Fruit {
styleUrls: ['chips-input-example.css'],
})
export class ChipsInputExample {
selectable = true;
removable = true;
addOnBlur = true;
readonly separatorKeysCodes = [ENTER, COMMA] as const;
fruits: Fruit[] = [{name: 'Lemon'}, {name: 'Lime'}, {name: 'Apple'}];
Expand Down

0 comments on commit a4ffc5e

Please sign in to comment.