I am searching SoundCloud's API and want to be able to add a song to the page once it is clicked from the search results. I am using Plangular and need to also append the tags for that. However, jQuery doesn't seem to like including Angular tags in the append function.
Here is the Search.js
$.ajax({
type: 'POST',
url: '/api/v1/add_song',
data: songParams,
success: function (newSong) {
$('#latest-posts').append(
"<div class='sc-track' plangular='"
+ newSong.url
+ "'><div class='pull-left'<img ng-src='{{track.artwork_url}}'></div> <h3>{{track.user.username}} - {{track.title}}</h3> <button ng-click='playPause()'>Play/Pause</button><progress ng-click='seek($event)' ng-value='currentTime / duration' > {{ currentTime / duration }} </progress> <br> <a ng-href='"
+ newSong.url
+ "'> View on SoundCloud </a>"
+ "</div>"
)
}
})
I am new to Angular, so I'm sure there is a better way to do this. Any help is greatly appreciated!