Here is a snippet of my JSON data:
{
"contact-info": {
"phonebook": [
{
"name": "John Snow",
"phones": [
{
"phone": "home",
"number": "1234"
}
],
"nick": "bastard"
},
{
"name": "Arya Stark",
"phones": [
{
"phone": "cell",
"number": "234"
},
{
"phone": "work",
"number": "345"
},
{
"phone": "home",
"number": "456"
}
],
"nick": "no one"
},
{
"name": "Theon",
"phones": [
{
"phone": "fax",
"number": "567"
}
],
"nick": "Reek"
},
{
"name": "Aemon",
"phones": [
{}
],
"nick": "maester"
}
]
}
}
I am attempting to use Angular to create a table that resembles this design: https://i.sstatic.net/e0w9q.png
Currently, I am able to display only the first phone number for each person using Angular:
tbody
tr( ng-repeat="person in JSON.contact-info.phonebook")
td {{person.name}}
td {{person.phones[0].phone}}
td {{person.phones[0].number}}
td {{person.nick}}
However, I am facing challenges when trying to loop through the nested 'phone' section. How can I achieve this?
Thank you