Is there a way for me to store the selected song artist in a variable within my JavaScript code? I need to have this value stored so that I can use it as a search term in another function. The expression {{selectedSong.artist}} returns a name, and I would like to save this name in a JavaScript variable.
<div class="list-group-item col-md-12">
<div class="col-md-6">
<p>
Title: <select ng-model="selectedSong" ng-options="song as song.title for song in songs.tracks"></select>
</p>
<p>
Artist: <select ng-model="selectedSong" ng-options="song as song.artist.name for song in songs.tracks"></select>
</p>
<p>
Time: <select ng-model="selectedSong" ng-options="song as (song.played_at | date: 'hh:mm') for song in songs.tracks">
</select>
</p>
</div>
<div class="col-md-6">
<button class="btn-success btn-lg" ng-click="selectedSong = songs.tracks[0]">Now playing</button>
</div>
</div>