1 import { Component, Input, Output, EventEmitter } from '@angular/core';
3 import { SortField, Video, VideoService } from '../shared';
4 import { User } from '../../shared';
7 selector: 'my-video-miniature',
8 styleUrls: [ './video-miniature.component.scss' ],
9 templateUrl: './video-miniature.component.html'
12 export class VideoMiniatureComponent {
13 @Output() removed = new EventEmitter<any>();
15 @Input() currentSort: SortField;
17 @Input() video: Video;
21 constructor(private videoService: VideoService) {}
24 return this.hovering && this.video.isRemovableBy(this.user);
28 this.hovering = false;
35 removeVideo(id: string) {
36 if (confirm('Do you really want to remove this video?')) {
37 this.videoService.removeVideo(id).subscribe(
38 status => this.removed.emit(true),
39 error => alert(error.text)