Created
October 5, 2017 04:10
-
-
Save tkssharma/7483c289dd8966c075e1ae73599bfb32 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: '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