我有一个FormGroup:
this.rooms = new FormGroup({
room: this._fb.array([
this._fb.group({
adultQuantity: [2],
childQuantity: [0],
childrenAges: this._fb.array([
new FormControl('', Validators.required)
])
})
])
});
数据从API获取:
room: [{
adultQuantity: 2,
childQuantity: 1,
childrenAges: [3,5]
},
{
adultQuantity: 2,
childQuantity: 2,
childrenAges: [3,2,9]
}]
如何将数据修补到FormGroup会议室。
抱歉,我英语不好。
谢谢大家。
答案 0 :(得分:0)