M
M
Maksim Mysak2015-08-07 01:30:02
JavaScript
Maksim Mysak, 2015-08-07 01:30:02

How to output given table from json object?

[
  {
    "category": "category0",
    "id": 0,
    "parent_category": [
      {
        "id": 0,
        "name": "parent_category0",
        "doctors": [
          {
            "name": "Lynn",
            "id": 0,
            "price": 14
          },
          {
            "name": "Ryan",
            "id": 1,
            "price": 67
          }
        ]
      },
      {
        "id": 1,
        "name": "parent_category1",
        "doctors": [
          {
            "name": "Reyes",
            "id": 0,
            "price": 12
          },
          {
            "name": "Wise",
            "id": 1,
            "price": 34
          }
        ]
      }
    ]
  },
  {
    "category": "category1",
    "id": 1,
    "parent_category": [
      {
        "id": 0,
        "name": "parent_category0",
        "doctors": [
          {
            "name": "Davenport",
            "id": 0,
            "price": 67
          },
          {
            "name": "Pickett",
            "id": 1,
            "price": 34
          }
        ]
      },
      {
        "id": 1,
        "name": "parent_category1",
        "doctors": [
          {
            "name": "Bennett",
            "id": 0,
            "price": 67
          }
        ]
      }
    ]
  },
  {
    "category": "category2",
    "id": 2,
    "parent_category": [
      {
        "id": 0,
        "name": "parent_category0",
        "doctors": [
          {
            "name": "Mccarty",
            "id": 0,
            "price": 14
          },
          {
            "name": "Gillespie",
            "id": 1,
            "price": 567
          }
        ]
      }
    ]
  },
  {
    "category": "category3",
    "id": 3,
    "parent_category": [
      {
        "id": 0,
        "name": "parent_category0",
        "doctors": [
          {
            "name": "Fowler",
            "id": 0,
            "price": 67
          },
          {
            "name": "Waller",
            "id": 1,
            "price": 567
          }
        ]
      }
    ]
  }
]

need a table
57bcaa2210d44d5d80a5e00a7d4eba8f.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2015-08-07
Protko @Fesor

1) transform the data so that there would be an array of objects, categories in the right order, and they would have a list of prices
2) display the table through ngRepeat

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question