Surendra0x2 Ответов: 1

Как прочитать этот json в angular js


"{"success":1,"pager":{"page":1,"per_page":50,"total":8},"results":[{"id":"28919295","sport_id":"4","time":"1537781400","time_status":"1","league":{"id":"9991615","name":"County Championship Div 1 Matches"},"home":{"id":"25506","name":"Hampshire"},"away":{"id":"36395","name":"Lancashire"},"our_event_id":"703252"},{"id":"28919296","sport_id":"4","time":"1537781400","time_status":"1","league":{"id":"9991615","name":"County Championship Div 1 Matches"},"home":{"id":"36396","name":"Nottinghamshire"},"away":{"id":"35814","name":"Somerset"},"our_event_id":"703312"},{"id":"28919302","sport_id":"4","time":"1537781400","time_status":"1","league":{"id":"9991615","name":"County Championship Div 1 Matches"},"home":{"id":"37313","name":"Surrey"},"away":{"id":"34775","name":"Essex"},"our_event_id":"703203"},{"id":"28919306","sport_id":"4","time":"1537781400","time_status":"1","league":{"id":"9991615","name":"County Championship Div 1 Matches"},"home":{"id":"36397","name":"Worcestershire"},"away":{"id":"36394","name":"Yorkshire"},"our_event_id":"703313"},{"id":"28919313","sport_id":"4","time":"1537781400","time_status":"1","league":{"id":"9991613","name":"County Championship Div 2 Matches"},"home":{"id":"37318","name":"Glamorgan"},"away":{"id":"37317","name":"Leicestershire"},"our_event_id":"703276"},{"id":"28919315","sport_id":"4","time":"1537781400","time_status":"1","league":{"id":"9991613","name":"County Championship Div 2 Matches"},"home":{"id":"37319","name":"Durham"},"away":{"id":"36401","name":"Middlesex"},"our_event_id":"703239"},{"id":"28919319","sport_id":"4","time":"1537781400","time_status":"1","league":{"id":"9991613","name":"County Championship Div 2 Matches"},"home":{"id":"37316","name":"Derbyshire"},"away":{"id":"36398","name":"Gloucestershire"},"our_event_id":"703238"},{"id":"28919322","sport_id":"4","time":"1537781400","time_status":"1","league":{"id":"9991613","name":"County Championship Div 2 Matches"},"home":{"id":"36399","name":"Warwickshire"},"away":{"id":"26182","name":"Kent"},"our_event_id":"703240"}]}"


Что я уже пробовал:

<tr ng-repeat="r in result.results track by $index">
<td>
{{r.home.name}}
&ЛТ;промежуток класс="glyphicon-звезда-пустые glyphicon" стиль="цвет: #ff9008;"&ГТ;&ЛТ;/службы&ГТ;
на <а href="event.html"и gt;{{р.результаты[0].дома.имя}} против {{Р.результаты[0].прочь.имя}}&ЛТ;/а&ГТ;
в <div стиль="текст-выровняйте: право"&ГТ;&ЛТ;малый&ГТ;15/09/2018 05:30&ЛТ;/малый&ГТ;&ЛТ;/дел&ГТ;
</td>


не удалось добраться home.name и еще away.name как этого добиться?

1 Ответов

Рейтинг:
2

pankajupadhyay29

видеть это Кодовое перо для кодового проекта 1261440[^]

он работает правильно.

Всегда полезно предоставить независимый работающий код, чтобы люди могли легко помочь вам. Создание такого рода независимой среды также поможет вам выявить свои ошибки.