这将是输出:
我不知道如何在模板中处理它
rateCardForm = this.fb.group({
package: this.fb.group({
freeDays: this.fb.array([]),
paidDays: this.fb.array([]),
}),
});
据我对您捕获的屏幕的了解:
rateCardForm = this.fb.group({
package: this.fb.array([
this.fb.group({
freeDays: [null],
paidDays: [null],
})
]),
});
用于将新项目添加到数组中:
Add(){
var _package=FormArray>this.rateCardForm.controls.package;
_package.push(
this.fb.group({
freeDays: [null],
paidDays: [null],
})
)
}