Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private retrieveSavedControls(options: string): FormArray{
- console.log(classes);
- this.profileForm= this.fb.group({
- optionGroups: this.fb.array([])
- })
- const control = <FormArray>this.profileForm.controls['optionGroups'];
- this.units = JSON.parse(options).optionGroups;
- console.log('parsed json: ',this.units);
- let index =0;
- this.units.forEach(unit => {
- control.push(this.fb.group({
- selectInput: ['', Validators.required],
- whereInput: [[], Validators.required]
- }));
- // this part should've loaded the list for each of the 2nd dropdown but not loading.
- this.wheres[unit.selectInput] = this.getWhere().filter((item)=> item.selectid == unit.selectInput);
- (<FormArray>this.profileForm.controls['optionGroups']).controls[index]
- .patchValue({ selectInput: unit.selectInput, whereInput: unit.whereInput});
- index++
- })
- console.log('control: ',control)
- return control;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement