Small task, tried so much I am not able to do this.
export class EmployeeDetails {
employee_id: number,
employee_name: string,
employee_startDate: string,
employee_endDate: string,
employee_startTime: string,
employee_endTime: string,
employee_city: string,
employee_country: string,
employee_phone: number,
employee_email: string
}
queryResponse = [
{
startDate: '01/01/2001’,
endDate: '02/02/2002’ ,
personDetails : [
{ id: 1, name: ‘mounika’, timeDetails: [{ startTime: ’9:00am’, endTime: ’4:00pm’, email: ‘mounika@gmail.com’, phone: ’9232323223’}, { startTime: ’10:00am’, endTime: ’5:00pm’, email: ‘mounika@gmail.com’, phone: ’9232323223’ }]},
{ id: 2, name: ‘ashish’, timeDetails: [{ startTime: ’10:00am’, endTime: ’6:00pm’, email: ‘ashish@gmail.com’, phone: ’93647626342’}, { startTime: ’11:00am’, endTime: ’7:00pm’, email: ‘ashish@gmail.com’, phone: ’93647626342’ }] } ,
{ id: 3, name: ‘sai’, timeDetails: [{ startTime: ’7:00am’, endTime: ’3:00pm’, email: ‘sai@gmail.com’, phone: ’9746236547’}, { startTime: ’8:00am’, endTime: ’5:00pm’, email: ‘sai@gmail.com’, phone: ’9746236547’ }] } ],
locationDetails : [{city: ‘Hyderabad’, country: ‘India’}, {city: ‘Chennai’, country: ‘India’}, {city: ‘Mumbai’, country: ‘India’} ]}
Looking for output like this. And also response is array of more objects that way (I mean response length is greater than 1). How can I have below output with multiple responses?
data : Array<EmployeeDetails> = [];
data = [
{ employee_id: 1, employee_name: ‘mounika’, employee_startDate: '01/01/2001’, employee_endDate: '02/02/2002’ , employee_startTime: ’10:00am’, endTime: ’5:00pm’, employee_email: ‘mounika@gmail.com’, employee_phone: ’9232323223’, employee_city: ‘Mumbai’, employee_country: ‘India’},
{ employee_id: 2, employee_name: ‘ashish’, employee_startDate: '01/01/2001’, employee_endDate: '02/02/2002’ , employee_startTime: ’11:00am’, employee_endTime: ’7:00pm’, employee_email: ‘ashish@gmail.com’, employee_phone: ’93647626342’, employee_city: ‘Mumbai’, employee_country: ‘India’},
{ employee_id: 3, employee_name: ‘sai’, employee_startDate: '01/01/2001’, employee_endDate: '02/02/2002’ , employee_startTime: ’8:00am’, employee_endTime: ’5:00pm’, employee_email: ‘sai@gmail.com’, employee_phone: ’9746236547’,employee_city: ‘Mumbai’, employee_country: ‘India’}
]