interface Customer {
id: string;
name: string;
}
customersToFormGroup(fb: FormBuilder, customers: Customer[]): FormGroup {
let ctrls = {};
for (let c of customers) {
for (let liquid of ["water", "wine"]) {
ctrls[`amount${liquid}_amt${c.id}`] = new FormControl("", Validators.required);
}
}
return fb.group(ctrls);
}