我有一个angularjs的React形式,并尝试初始化几个字段:
initializeBusinessEposForm(): void {
this.businessEposForm = this.formBuilder.group({
custom_pos_priority: new FormControl(false),
custom_float_menu: new FormControl(false),
epos_quick_code_print: new FormControl(false),
permission: this.formBuilder.group({
isEposCustomerData: new FormControl(false),
stripe_terminal_processor: new FormControl(''),
tips: [],
}),
});
}
这里的tips是一个数组,包含以下值:
[
{
"name": "gratuity_tip",
"isActive": false,
"orderType": []
},
{
"name": "terminal_tip",
"isActive": true,
"orderType": [
1,
4
]
}
]
现在如何将此数组作为数组添加到tips: []
1条答案
按热度按时间ygya80vv1#
你试过使用FormArray吗?