I am working on setting up a reactive form for AngularJS and need to initialize certain fields:
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: [],
}),
});
}
The tips field is an array with the following values:
[
{
"name": "gratuity_tip",
"isActive": false,
"orderType": []
},
{
"name": "terminal_tip",
"isActive": true,
"orderType": [
1,
4
]
}
]
Now, I am trying to figure out how to add these arrays to tips: []
as an array.