Skip to content

Instantly share code, notes, and snippets.

@tkssharma
Created October 5, 2017 04:10
Show Gist options
  • Save tkssharma/7483c289dd8966c075e1ae73599bfb32 to your computer and use it in GitHub Desktop.
Save tkssharma/7483c289dd8966c075e1ae73599bfb32 to your computer and use it in GitHub Desktop.
@Component({
selector: 'video-list',
templateUrl: 'video-list.html'
})
class VideoList implements OnInit {
@Input() Videos:video[] ;
ngOnInit(){
console.log(this.Videos);
}
}
export default VideoList;
//--------------------------------------------------//
export default class SearchBar implements OnInit {
@Input() selectVideo: any;
videoId: any;
id: string;
url: SafeResourceUrl;
constructor(public sanitizer:DomSanitizer) {
}
ngOnInit() {
if(this.selectVideo){
this.videoId = this.selectVideo.id.videoId;
this.id = `https://www.youtube.com/embed/${this.videoId}`;
this.url = this.sanitizer.bypassSecurityTrustResourceUrl(this.id);
console.log(this.url);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment