export class VideoMiniatureComponent {
@Output() removed = new EventEmitter<any>();
- @Input() video: Video;
@Input() user: User;
+ @Input() video: Video;
- hovering: boolean = false;
+ hovering = false;
- constructor(private _videoService: VideoService) {}
+ constructor(private videoService: VideoService) {}
- onHover() {
- this.hovering = true;
+ displayRemoveIcon() {
+ return this.hovering && this.video.isRemovableBy(this.user);
}
onBlur() {
this.hovering = false;
}
- displayRemoveIcon(): boolean {
- return this.hovering && this.video.isRemovableBy(this.user);
+ onHover() {
+ this.hovering = true;
}
removeVideo(id: string) {
if (confirm('Do you really want to remove this video?')) {
- this._videoService.removeVideo(id).subscribe(
+ this.videoService.removeVideo(id).subscribe(
status => this.removed.emit(true),
error => alert(error)
);