1 import { DatePipe } from '@angular/common';
2 import { Component, Input, Output, EventEmitter } from '@angular/core';
3 import { ROUTER_DIRECTIVES } from '@angular/router-deprecated';
5 import { Video, VideoService } from '../shared/index';
6 import { User } from '../../users/index';
9 selector: 'my-video-miniature',
10 styleUrls: [ 'client/app/videos/video-list/video-miniature.component.css' ],
11 templateUrl: 'client/app/videos/video-list/video-miniature.component.html',
12 directives: [ ROUTER_DIRECTIVES ],
16 export class VideoMiniatureComponent {
17 @Output() removed = new EventEmitter<any>();
19 @Input() video: Video;
22 hovering: boolean = false;
24 constructor(private _videoService: VideoService) {}
31 this.hovering = false;
34 displayRemoveIcon(): boolean {
35 return this.hovering && this.video.isRemovableBy(this.user);
38 removeVideo(id: string) {
39 if (confirm('Do you really want to remove this video?')) {
40 this._videoService.removeVideo(id).subscribe(
41 status => this.removed.emit(true),