How to incorporate datatables 1.10.x in my angular6 project?

How to incorporate datatables 1.10.x in my angular6 project?

amritaramnauthamritaramnauth Posts: 1Questions: 1Answers: 0

I'm using angular6.0.x and datatables 1.10.x in a project where I have a complex json data set being returned to display in the datatable. When I use an ngFor on my tr, I am able to get the data but I lose all functionality shipped with the datatables. I'm sure there's a formatting issue to address with my json. How do I go about formatting a complex json response like the one below:

I need to display first name, last name, country of birth for each obj within the array....my efforts with the datatables columns.data API were futile.
[
{
"_id": "val",
"additional_detail": {
"status": "Accepted"
},
"citizenship": {
"country_of_birth": "SA",
"place_of_birth": "somewhere"
},
"person": {
"first_name": "Kirk",
"last_name": "Watsica",
"title": "Miss",
}
},
{
"_id": "val2",
"additional_detail": {
"status": "Rejected"
},
"citizenship": {
"country_of_birth": "LA",
"place_of_birth": "Housten"
},
"person": {
"first_name": "John",
"last_name": "Doe",
"title": "Miss",
}
},
{
"_id": "val3",
"additional_detail": {
"status": "Rejected"
},
"citizenship": {
"country_of_birth": "LA",
"place_of_birth": "Housten"
},
"person": {
"first_name": "John",
"last_name": "Doe",
"title": "Miss",
}
}.......
]

Also, is it possible to go about putting title + first_name + last_name in a column? If so, how?

Answers

This discussion has been closed.