spotify / apps-tutorial

A Spotify App that contains working examples of the use of Spotify Apps API
https://developer.spotify.com/technologies/apps/
627 stars 146 forks source link

Cannot read property 'subscribers' of undefined #19

Closed 0m15 closed 11 years ago

0m15 commented 11 years ago

In order to get a Playlist.subscribers count, I'm doing this:

var playlist = models.Playlist.fromURI(playlist_uri)
playlist.subscribers.snapshot().done(function(users) {
      console.log('users', users.function)
})

But I get this error on console:

TypeError: Cannot call method 'snapshot' of undefined

Of course, the playlist is a valid one.

I'm using Preview API (1.0)

0m15 commented 11 years ago
models.Playlist.fromURI(playlist_uri)
  .load(['subscribers'])
  .done(function(p) {
    p.subscribers.snapshot().done(function(s) {
      console.log(s)
    })
  })