MCPcopy Create free account
hub / github.com/angular/components / edit

Method edit

src/dev-app/chips/chips-demo.ts:122–132  ·  view source on GitHub ↗
(person: Person, event: MatChipEditedEvent)

Source from the content-addressed store, hash-verified

120 }
121
122 edit(person: Person, event: MatChipEditedEvent): void {
123 if (!event.value.trim().length) {
124 this.remove(person);
125 return;
126 }
127
128 const index = this.people.indexOf(person);
129 const newPeople = this.people.slice();
130 newPeople[index] = {...newPeople[index], name: event.value};
131 this.people = newPeople;
132 }
133
134 toggleVisible(): void {
135 this.visible = false;

Callers

nothing calls this directly

Calls 1

removeMethod · 0.95

Tested by

no test coverage detected