угол повтора вложенного JSON

0

Я застрял, задаваясь вопросом, как выполнить ng-repeat совпадения в этом объекте JSON. Я пробовал различные способы с некоторыми из них, как это, но не повезло.

<tr ng-repeat="game in game.competition.season.round.match">
  <td>{% verbatim %}{{ game["@attributes"].match_id }}{% endverbatim %}</td>
</tr> 

Когда я использую весь объект в ng-repeat, я могу получить значение самого первого ключа "@attributes", но не может получить совпадения.

Буду признателен за любую оказанную помощь.

[
  {
    "@attributes": {
      "id": "1",
      "name": "World",
      "last_updated": "2016-03-22 06:22:49"
    },
    "competition": {
      "@attributes": {
        "id": "19",
        "name": "Sony",
        "area_id": "203",
        "area_name": "USA",
        "last_updated": "2016-03-22 09:19:52"
      },
      "season": {
        "@attributes": {
          "season_id": "3628",
          "name": "2016",
          "start_date": "2016-03-21",
          "end_date": "2016-04-03",
          "draw_size": "64",
          "active": "yes",
        },
        "round": [
          {
            "@attributes": {
              "round_id": "21868",
              "title": "1/128 Final",
              "start_date": "2016-03-22",
              "end_date": "2016-03-26",
              "groups": "0",
              "last_updated": "2016-03-22 06:22:49"
            },
            "match": [
              {
                "@attributes": {
                  "match_id": "155624",
                  "official_start_date": "2016-03-22",
                  "official_start_time": "14:00:00",
                  "actual_start_date": "",
                  "actual_start_time": "",

                }
              },
              {
                "@attributes": {
                  "match_id": "155625",
                  "official_start_date": "2016-03-22",
                  "official_start_time": "14:00:00",
                  "actual_start_date": "",
                  "actual_start_time": "",
                  "winner": "yet unknown",
                  "score_A": "",
                  "score_B": "",
                  "status": "Fixture",
                  "drawposition": "38",
                  "person_A_id": "14688",
                }
              },
              {
                "@attributes": {
                  "match_id": "155626",
                  "official_start_date": "2016-03-22",
                  "official_start_time": "14:00:00",
                  "actual_start_date": "",
                  "actual_start_time": "",
                  "winner": "yet unknown",
                  "score_A": "",
                  "score_B": "",
                }
              },
              {
                "@attributes": {
                  "match_id": "155627",
                  "official_start_date": "2016-03-22",
                  "official_start_time": "14:00:00",
                  "actual_start_date": "",
                  "actual_start_time": "",
                  "winner": "yet unknown",
                  "score_A": "",
                }
              },
              {
                "@attributes": {
                  "match_id": "155628",
                  "official_start_date": "2016-03-22",
                  "official_start_time": "14:00:00",
                  "actual_start_date": "",
                  "actual_start_time": "",
                  "winner": "yet unknown",
                  "score_A": "",
                  "score_B": "",
                }
              },
              {
                "@attributes": {
                  "match_id": "155629",
                  "official_start_date": "2016-03-22",
                  "official_start_time": "14:00:00",
                  "actual_start_date": "",
                  "actual_start_time": "",
                  "winner": "yet unknown",
                  "score_A": "",
                  "score_B": "",
                }
              }
            ]
          }
        ]
      }
    }
  }
]
  • 0
    Вы пытались удалить @ в атрибутах и повторить попытку?
  • 0
    Каков желаемый результат?
Показать ещё 4 комментария
Теги:
twig

1 ответ

1
Лучший ответ

должен быть таким,

  <table>
    <tr ng-repeat="game in game[0].competition.season.round[0].match">
  <td>{% verbatim %}{{ game["@attributes"].match_id }}{% endverbatim %}</td>
</tr>

  </table>
  • 0
    извини на самом деле, как это. у вас есть несколько массивов друг в друге.
  • 0
    к сожалению это не работает
Показать ещё 4 комментария

Ещё вопросы

Сообщество Overcoder
Наверх
Меню