Announcements

Help Wizard

Step 1

NEXT STEP

FAQs

Please see below the most popular frequently asked questions.

Loading article...

Loading faqs...

VIEW ALL

Ongoing Issues

Please see below the current ongoing issues which are under investigation.

Loading issue...

Loading ongoing issues...

VIEW ALL

Data binding with Authorization code PKCE

Data binding with Authorization code PKCE

Hi,

 

I am learning to code with the Spotify API. I tried playing with the demoware in the web api github repo. I am trying to understand how the data binding works in the example, and when I searched up the syntax, or for 'basic javascript data binding' I have not been able to find information regarding the method that is used in the tutorial. The most popular result I have seen is for the knockout framework, and while the syntax seems to be a bit similar, I do not believe it is used. In fact, the documentation says that it only employs basic data binding.

 

From my understanding after analyzing the code, the data binding in the PKCE example works by matching the html data-bind attribute's value in a html element with the attribute name in the json response for the api request. For example, there is an attribute called 'display_name' in the response for getting the user's profile endpoint. Similarly, there is an element in the html code with a data-bind attribute with the value: 'display_name'.

 

However, I wanted to try listing multiple song names on the page, so I tried using the top user songs api. I was able to console log a concatenation of all the songs, but I was not able to bind each individual song to a corresponding element. 

 

I was wondering if anyone else know how to do this? Do I need to use another method or framework for data-binding?

Reply
0 Replies

Suggested posts