Created
October 7, 2017 12:09
-
-
Save tkssharma/0c5f77f6fdf7827634a31c58411d92f6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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