(event: MatChipInputEvent)
| 1218 | addOnBlur: boolean = true; |
| 1219 | |
| 1220 | add(event: MatChipInputEvent): void { |
| 1221 | const value = (event.value || '').trim(); |
| 1222 | |
| 1223 | // Add our foods |
| 1224 | if (value) { |
| 1225 | this.foods.update(current => [ |
| 1226 | ...current, |
| 1227 | { |
| 1228 | value: `${value.toLowerCase()}-${current.length}`, |
| 1229 | viewValue: value, |
| 1230 | }, |
| 1231 | ]); |
| 1232 | } |
| 1233 | |
| 1234 | // Reset the input value |
| 1235 | event.chipInput!.clear(); |
| 1236 | } |
| 1237 | |
| 1238 | remove(food: any): void { |
| 1239 | const index = this.foods().indexOf(food); |
no test coverage detected