This is my JSON.
[
{
"site":"New York",
"players":[{"name":"Mike"},{"name":"Tom"}],
"journalists":[{"name":"Alice"},{"name":"Bob"}],
"managers":[]
},
{
"site":"Barcelona",
"players":[{"name":"James"},{"name":"Paul"}],
"journalists":[{"name":"John"}],
"managers":[{"name":"Kenny"},{"name":"Tim"}]
}
]
I want to display it like this:
New York:
- journlists: Alice, Bob
- players: Mike, Tom
Barcelona:
- journlists: John
- players: James, Paul
- managers: Kenny, Tim
Let's say I can get the json data from scope $scope.myJson. I can't figure out how to use ng-repeat and ng-show (do not show empty arrays) together to achieve this.