0

I'm new with angular2,I need to get my playlist videos from Youtube with angular 2 and Youtube API, but I don't know the best form to begin this task, anyone can help me?

thiago.adriano26
  • 1,491
  • 3
  • 14
  • 19
  • 1
    You should checkout [angular-cli](https://github.com/angular/angular-cli). [The official docs](https://angular.io) are also a good place to start. – Jack Clancy Apr 13 '17 at 02:08

2 Answers2

1

You may refer with this related thread: Get all YouTube Videos in a Playlist using Angular JS. From the documentation, use the nextPageToken attribute from the api response.Call the API one or more times to retrieve all items in the list. As long as the API response returns a nextPageToken, there are still more items to retrieve.

In your controller, define a local variable nextPageToken to retrieve the next page and call the getPlaylistVideos with the nextPageToken attribute recursively until all the results are retrieved.

Be also noted that the function getPlaylistVideos doesn't return anything, it updates the $scope.playlistVideos variable with the fetched playlist items. Also the function getPlaylistVideos uses the scope variable nextPageToken to fetch next page.

Hope this helps!

Community
  • 1
  • 1
abielita
  • 13,147
  • 2
  • 17
  • 59
0

This code below helps me with this task

enter link description here

thiago.adriano26
  • 1,491
  • 3
  • 14
  • 19