diff options
Diffstat (limited to 'client/angular/videos/components/list/videos-list.component.ts')
-rw-r--r-- | client/angular/videos/components/list/videos-list.component.ts | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/client/angular/videos/components/list/videos-list.component.ts b/client/angular/videos/components/list/videos-list.component.ts index 6ff0b2afb..6fc0c1f04 100644 --- a/client/angular/videos/components/list/videos-list.component.ts +++ b/client/angular/videos/components/list/videos-list.component.ts | |||
@@ -3,14 +3,15 @@ import { ROUTER_DIRECTIVES, RouteParams } from '@angular/router-deprecated'; | |||
3 | 3 | ||
4 | import { AuthService } from '../../../users/services/auth.service'; | 4 | import { AuthService } from '../../../users/services/auth.service'; |
5 | import { User } from '../../../users/models/user'; | 5 | import { User } from '../../../users/models/user'; |
6 | import { VideosService } from '../../services/videos.service'; | 6 | import { VideosService } from '../../videos.service'; |
7 | import { Video } from '../../models/video'; | 7 | import { Video } from '../../video'; |
8 | import { VideoMiniatureComponent } from './video-miniature.component'; | ||
8 | 9 | ||
9 | @Component({ | 10 | @Component({ |
10 | selector: 'my-videos-list', | 11 | selector: 'my-videos-list', |
11 | styleUrls: [ 'app/angular/videos/components/list/videos-list.component.css' ], | 12 | styleUrls: [ 'app/angular/videos/components/list/videos-list.component.css' ], |
12 | templateUrl: 'app/angular/videos/components/list/videos-list.component.html', | 13 | templateUrl: 'app/angular/videos/components/list/videos-list.component.html', |
13 | directives: [ ROUTER_DIRECTIVES ] | 14 | directives: [ ROUTER_DIRECTIVES, VideoMiniatureComponent ] |
14 | }) | 15 | }) |
15 | 16 | ||
16 | export class VideosListComponent implements OnInit { | 17 | export class VideosListComponent implements OnInit { |
@@ -50,11 +51,8 @@ export class VideosListComponent implements OnInit { | |||
50 | ); | 51 | ); |
51 | } | 52 | } |
52 | 53 | ||
53 | removeVideo(id: string) { | 54 | onRemoved(video: Video): void { |
54 | this._videosService.removeVideo(id).subscribe( | 55 | this.videos.splice(this.videos.indexOf(video), 1); |
55 | status => this.getVideos(), | ||
56 | error => alert(error) | ||
57 | ); | ||
58 | } | 56 | } |
59 | 57 | ||
60 | } | 58 | } |