How to use Spotify Views API? -
how use spotifies views api right way?
https://developer.spotify.com/technologies/apps/docs/preview/views/index.html
i trying implement throbber in div, use code:
require(['$views/throbber#throbber'], function(throbber) { var favs = document.getelementbyid('favs'); var throbber = throbber.forelement(favs); });
but throwing "referenceerror: require not defined". when use this:
var sp = getspotifyapi(); sp.require(['$views/throbber#throbber'], function(throbber) { var favs = document.getelementbyid('favs'); var throbber = throbber.forelement(favs); });
it throwing error." typeerror: object $views/throbber#throbber has no method 'match' ".
the throbber component available on 1.x api, using syntax of first code snippet.
in order let spotify client know using version of api need specify in manifest.json
file using 1.x api adding dependencies
attribute including api
, views
framework:
"dependencies": { "api": "1.0.0", "views": "1.0.0" }
Comments
Post a Comment