0
[
  {
    "id": "1231",
    "hero": "xys",
    "lastAddedDate": "2019-01-16",
    "movieDetails": [
      {
        "id": 1,
        "movie": "xasdas",
        "director": "jdnka",
        "release date": "2019-01-19 18:33:51.894"
      },
      {
        "id": 2,
        "movie": "zgh",
        "director": "Approved",
        "release date": "2019-01-19 18:33:51.894"
      }
    ]
  },
  {
    "id": "123",
    "hero": "xysz",
    "lastAddedDate": "2019-01-16",
    "movieDetails": [
      {
        "id": 1,
        "movie": "asdxasdasasd",
        "director": "asdfsjdnka",
        "release date": "2019-01-19 18:33:51.894"
      },
      {
        "id": 2,
        "movie": "zygtas",
        "director": "owq",
        "release date": "2019-01-19 18:33:51.894"
      }
    ]
  }
]

In this JSON, I want to spread all the data using ngxDatatable in the form of a table. Here, I'm facing with movieDetails array. when i try to populate movieDetails in table it is giving undefined.

Here is the format of my table

Id | Hero | LastAddedDate | Movie1 | Movie1Director | Movie1ReleaseDate | Movie2 | Movie2Director | movie2ReleaseDate

| - Column Seperator

  • In your JSON `movieDetails` is an array, you have to transform the data structure based on how you want to present them in UI. It seems you are treating them like objects here. – Santhosh V Jan 21 '19 at 07:45
  • actually i want to extract all movies from that array and present in table. do you have any idea how to do that? – Naga Lokesh Kannumoori Jan 21 '19 at 07:53

0 Answers0