(event: MatChipInputEvent)
| 1205 | addOnBlur: boolean = true; |
| 1206 | |
| 1207 | add(event: MatChipInputEvent): void { |
| 1208 | const value = (event.value || '').trim(); |
| 1209 | |
| 1210 | // Add our foods |
| 1211 | if (value) { |
| 1212 | this.foods.update(current => [ |
| 1213 | ...current, |
| 1214 | { |
| 1215 | value: `${value.toLowerCase()}-${current.length}`, |
| 1216 | viewValue: value, |
| 1217 | }, |
| 1218 | ]); |
| 1219 | } |
| 1220 | |
| 1221 | // Reset the input value |
| 1222 | event.chipInput!.clear(); |
| 1223 | } |
| 1224 | |
| 1225 | remove(food: any): void { |
| 1226 | const index = this.foods().indexOf(food); |
no test coverage detected