Created
October 5, 2017 04:04
-
-
Save tkssharma/b3b5b3dcd4ed805d3f8ca4be6a7710bb 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
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; | |
}) | |
} | |
SearchValueChange(event:any){ | |
this.loaded = false; | |
var params = { | |
part: 'snippet', | |
q: event.value, | |
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