I'm trying to create a temporary playlist through Spotify API with this code:
var playlist = models.Playlist.createTemporary("My temporary playlist");
models.Playlist.createTemporary("My temporary playlist").load('tracks').done(function(playlist) {
playlist.tracks.add(models.Track.fromURI("spotify:track:4VqPOruhp5EdPBeR92t6lQ"));
playlist.tracks.add(models.Track.fromURI("spotify:track:5HF5PRNJ8KGtbzNPPc93tG"));
});
var list = List.forPlaylist(playlist);
document.getElementById('playlistContainer').appendChild(list.node);
list.init();
But I'm getting the following error:
core.js:4 - Uncaught TypeError: Object #<Promise> has no method 'load'
Any idea what I'm doing wrong? Thanks.