1 import { Component, Input, Output, EventEmitter } from '@angular/core';
2 import { DatePipe } from '@angular/common';
3 import { ROUTER_DIRECTIVES } from '@angular/router-deprecated';
5 import { Video } from '../../video';
6 import { VideosService } from '../../videos.service';
7 import { User } from '../../../users/models/user';
10 selector: 'my-video-miniature',
11 styleUrls: [ 'app/angular/videos/components/list/video-miniature.component.css' ],
12 templateUrl: 'app/angular/videos/components/list/video-miniature.component.html',
13 directives: [ ROUTER_DIRECTIVES ],
17 export class VideoMiniatureComponent {
18 @Output() removed = new EventEmitter<any>();
20 @Input() video: Video;
23 hovering: boolean = false;
25 constructor(private _videosService: VideosService) {}
32 this.hovering = false;
35 displayRemoveIcon(): boolean {
36 return this.hovering && this.video.isRemovableBy(this.user);
39 removeVideo(id: string) {
40 if (confirm('Do you really want to remove this video?')) {
41 this._videosService.removeVideo(id).subscribe(
42 status => this.removed.emit(true),