Hello everyone,
I need to create an app where I've got a table with:
- Columns: day of selected month;
- Rows: firstname & lastname
In this app the user can add rows, and in every row he has to write the working hours for each day.
The base data array is something like:
{
"WorkingHoursCalendar": [
{
"name": "Paul",
"days": [
{
"date": "1/08/2021",
"hours": 0
},
{
"date": "2/08/2021",
"hours": 0
},
{
"date": "3/08/2021",
"hours": 0
},
{
"date": "4/08/2021",
"hours": 0
},
{
"date": "5/08/2021",
"hours": 0
}
]
},
{
"name": "Anne",
"days": [
{
"date": "1/08/2021",
"hours": 0
},
{
"date": "2/08/2021",
"hours": 8
},
{
"date": "3/08/2021",
"hours": 8
},
{
"date": "4/08/2021",
"hours": 8
},
{
"date": "5/08/2021",
"hours": 0
}
]
},
{
"name": "John",
"days": [
{
"date": "1/08/2021",
"hours": 8
},
{
"date": "2/08/2021",
"hours": 0
},
{
"date": "3/08/2021",
"hours": 0
},
{
"date": "4/08/2021",
"hours": 0
},
{
"date": "5/08/2021",
"hours": 0
}
]
}
]
}
My problem is that I don't understand how to transform the {date,hours} array in formComponent/formArray.
I created a formArray that contains one formComponent foreach "name" in the array, but I really don't understand how to proceed after that.
Can someone help me?