]>
Commit | Line | Data |
---|---|---|
1 | import { Component, OnInit } from '@angular/core' | |
2 | import { ActivatedRoute, Router } from '@angular/router' | |
3 | import { NotificationsService } from 'angular2-notifications' | |
4 | import { AuthService } from '../../core/auth' | |
5 | import { AbstractVideoList } from '../../shared/video/abstract-video-list' | |
6 | import { SortField } from '../../shared/video/sort-field.type' | |
7 | import { VideoService } from '../../shared/video/video.service' | |
8 | ||
9 | @Component({ | |
10 | selector: 'my-videos-trending', | |
11 | styleUrls: [ '../../shared/video/abstract-video-list.scss' ], | |
12 | templateUrl: '../../shared/video/abstract-video-list.html' | |
13 | }) | |
14 | export class VideoTrendingComponent extends AbstractVideoList implements OnInit { | |
15 | titlePage = 'Trending' | |
16 | currentRoute = '/videos/trending' | |
17 | defaultSort: SortField = '-views' | |
18 | ||
19 | constructor (protected router: Router, | |
20 | protected route: ActivatedRoute, | |
21 | protected notificationsService: NotificationsService, | |
22 | protected authService: AuthService, | |
23 | private videoService: VideoService) { | |
24 | super() | |
25 | } | |
26 | ||
27 | ngOnInit () { | |
28 | super.ngOnInit() | |
29 | } | |
30 | ||
31 | getVideosObservable () { | |
32 | return this.videoService.getVideos(this.pagination, this.sort) | |
33 | } | |
34 | } |