Here is some JSON data:
{
"tracks": [
{
"album": {
"released": "2013",
"href": "spotify:album:3qGeRY1wt4rrLIt1YuSwHR",
"name": "The Marshall Mathers LP2 (Deluxe)",
"availability": {
"territories": "AD AR AT AU BE BG BO BR CH CL CO CR CY CZ DE DK DO EC EE ES FI FR GB GR GT HK HN HR HU IE IS IT LI LT LU LV MC MT MY NI NL NO NZ PA PE PH PL PT PY RO SE SG SI SK SV TR TW UY"
}
},
"name": "The Monster",
"popularity": "0.94",
"external-ids": [
{
"type": "isrc",
"id": "USUM71314082" <-- The desired value
}
],
"length": 250.188,
"href": "spotify:track:5U8hKxSaDXB8cVeLFQjvwx",
"artists": [
{
"href": "spotify:artist:7dGJo4pcD2V6oG8kP0tJRR",
"name": "Eminem"
},
{
"href": "spotify:artist:5pKCCKE2ajJHZ9KAiaK11H",
"name": "Rihanna"
}
],
"track-number": "12"
},
...
]}
I can extract other values like album name and release date, but am struggling with the external-ids id. I have attempted two solutions in my Angular template:
<div class="panel panel-success" ng-repeat="track in something.tracks">
<p>Track name: {{ track.name }}</p>
<p>Album release date: {{ track.album.released }}</p>
<p>Spotify id: {{track.external-ids[0].id}} </p>
<!-- <span ng-repeat="obj in track.external-ids">
<p>Spotify id: {{ obj.id }}</p>
</span> -->
</div>
Both solutions have failed - the first returns 0, while the second doesn't display the "Spotify id:" line at all.
If anyone knows how to achieve this, please share your insights. Thank you.