javascript - Save DZ.api response in variable -
using code below can console.log response in function(response) part, not in second console.log. how can extract string out of dz.api , child/any variable, when using dzsearch function?
@injectable() export class deezerservice{ child:any; constructor(){ new dz.init({ appid : 'appid', channelurl : 'https://localhost:4200/src/channel.html' }); } dzsearch(){ console.log('testing dzsearch() init'); this.child = dz.api('/album/12720342/tracks', function(response){ console.log(response.data[0].title) return response.data[0].title; }); console.log(this.child); } }
Comments
Post a Comment