Skip to content

Instantly share code, notes, and snippets.

@tkssharma
Created October 7, 2017 12:09
Show Gist options
  • Save tkssharma/0c5f77f6fdf7827634a31c58411d92f6 to your computer and use it in GitHub Desktop.
Save tkssharma/0c5f77f6fdf7827634a31c58411d92f6 to your computer and use it in GitHub Desktop.
@Component({selector: 'youtube', templateUrl: './youtube.html'})
export default class Youtube implements OnInit {
Videos : video[];
loaded : boolean;
API_KEY : string;
selectVideo : video;
opts : any;
constructor() {
}
ngOnInit() {
this.loaded = false;
var params = {
part: 'snippet',
q: 'Still into You paramore',
maxResults: 5
}
client.search(params, (err:any, data:any) => {
// your magic..
console.dir(data);
this.Videos = data.items;
this.selectVideo = data.items[2]
this.loaded = true;
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment