this.form = new FormGroup({
name: new FormControl(null, Validators.required),
descr: new FormControl(null, Validators.required),
attributes: new FormArray([])
})
onSelectProject(project: Project) {
this.projectId =
project.id this.projectService.getOne(project).subscribe(project => {
this.project = project
this.loading = false
//console.log(project.attributes);
const attributesGroups =
project.attributes.map(attribute => ({
name:
attribute.name,
value: attribute.value,
descr: attribute.descr,
attribute_id: attribute.attribute_id,
}));
this.form =
this.fb.group({
name:
project.name,
descr: project.descr,
attributes: this.fb.array(attributesGroups)
});
//console.log(this.form);
consoleconsole.log(this.form.get('attributes')['controls'])
});
this.modal.open()
MaterialService.
updateTextInputs()
}