Requests chain and observable

18 views
Skip to first unread message

oxy gene

unread,
Aug 19, 2020, 11:51:27 PM8/19/20
to Angular and AngularJS discussion
Hello,

I m trying to retrieve video details from youtube API,  first I need to get list of video and then send a request for each video id (I need this second request to get more details of the video) :

#1 : request for mostpopular videos:  
 getVideosList() {
       return  this.http.get('https://www.googleapis.com/youtube/v3/search? , 
       {params: {...} })
   }
 // return {..."items": [  { 'id': 'id1', 'title' : 'videotitle1' }, {'id': 'id2', 'title' : 'videotitle2'} , ...] ...} 
 
#2 Send a GET request for each video id (id1, id2......) and return and array with response of all the get request.

I m stuck with observable to chain this two step of request ? 

Could some body can help me please ?

Thanks you



Reply all
Reply to author
Forward
0 new messages