diff options
Diffstat (limited to 'client/src/app/shared')
-rw-r--r-- | client/src/app/shared/video/abstract-video-list.ts | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/client/src/app/shared/video/abstract-video-list.ts b/client/src/app/shared/video/abstract-video-list.ts index ba1635a18..2b6870a78 100644 --- a/client/src/app/shared/video/abstract-video-list.ts +++ b/client/src/app/shared/video/abstract-video-list.ts | |||
@@ -2,6 +2,7 @@ import { OnInit } from '@angular/core' | |||
2 | import { ActivatedRoute, Router } from '@angular/router' | 2 | import { ActivatedRoute, Router } from '@angular/router' |
3 | import { NotificationsService } from 'angular2-notifications' | 3 | import { NotificationsService } from 'angular2-notifications' |
4 | import { Observable } from 'rxjs/Observable' | 4 | import { Observable } from 'rxjs/Observable' |
5 | import { AuthService } from '../../core/auth' | ||
5 | import { SortField } from './sort-field.type' | 6 | import { SortField } from './sort-field.type' |
6 | import { VideoPagination } from './video-pagination.model' | 7 | import { VideoPagination } from './video-pagination.model' |
7 | import { Video } from './video.model' | 8 | import { Video } from './video.model' |
@@ -17,9 +18,10 @@ export abstract class AbstractVideoList implements OnInit { | |||
17 | videos: Video[] = [] | 18 | videos: Video[] = [] |
18 | loadOnInit = true | 19 | loadOnInit = true |
19 | 20 | ||
20 | protected notificationsService: NotificationsService | 21 | protected abstract notificationsService: NotificationsService |
21 | protected router: Router | 22 | protected abstract authService: AuthService |
22 | protected route: ActivatedRoute | 23 | protected abstract router: Router |
24 | protected abstract route: ActivatedRoute | ||
23 | 25 | ||
24 | protected abstract currentRoute: string | 26 | protected abstract currentRoute: string |
25 | 27 | ||
@@ -28,6 +30,10 @@ export abstract class AbstractVideoList implements OnInit { | |||
28 | 30 | ||
29 | abstract getVideosObservable (): Observable<{ videos: Video[], totalVideos: number}> | 31 | abstract getVideosObservable (): Observable<{ videos: Video[], totalVideos: number}> |
30 | 32 | ||
33 | get user () { | ||
34 | return this.authService.getUser() | ||
35 | } | ||
36 | |||
31 | ngOnInit () { | 37 | ngOnInit () { |
32 | // Subscribe to route changes | 38 | // Subscribe to route changes |
33 | const routeParams = this.route.snapshot.params | 39 | const routeParams = this.route.snapshot.params |