1 import { DatePipe } from '@angular/common';
2 import { Component, Input, Output, EventEmitter } from '@angular/core';
3 import { ROUTER_DIRECTIVES } from '@angular/router';
5 import { SortField, Video, VideoService } from '../shared';
6 import { User } from '../../shared';
9 selector: 'my-video-miniature',
10 styles: [ require('./video-miniature.component.scss') ],
11 template: require('./video-miniature.component.html'),
12 directives: [ ROUTER_DIRECTIVES ],
16 export class VideoMiniatureComponent {
17 @Output() removed = new EventEmitter<any>();
19 @Input() currentSort: SortField;
21 @Input() video: Video;
25 constructor(private videoService: VideoService) {}
28 return this.hovering && this.video.isRemovableBy(this.user);
32 this.hovering = false;
39 removeVideo(id: string) {
40 if (confirm('Do you really want to remove this video?')) {
41 this.videoService.removeVideo(id).subscribe(
42 status => this.removed.emit(true),