]>
Commit | Line | Data |
---|---|---|
170726f5 C |
1 | import { Component, OnInit } from '@angular/core' |
2 | import { ActivatedRoute } from '@angular/router' | |
170726f5 C |
3 | import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' |
4 | import { VideoChannel } from '@app/shared/video-channel/video-channel.model' | |
b1d40cff | 5 | import { I18n } from '@ngx-translate/i18n-polyfill' |
170726f5 C |
6 | |
7 | @Component({ | |
8 | selector: 'my-video-channel-about', | |
9 | templateUrl: './video-channel-about.component.html', | |
10 | styleUrls: [ './video-channel-about.component.scss' ] | |
11 | }) | |
12 | export class VideoChannelAboutComponent implements OnInit { | |
13 | videoChannel: VideoChannel | |
14 | ||
15 | constructor ( | |
b1d40cff C |
16 | private route: ActivatedRoute, |
17 | private i18n: I18n, | |
170726f5 C |
18 | private videoChannelService: VideoChannelService |
19 | ) { } | |
20 | ||
21 | ngOnInit () { | |
22 | // Parent get the video channel for us | |
23 | this.videoChannelService.videoChannelLoaded | |
24 | .subscribe(videoChannel => this.videoChannel = videoChannel) | |
25 | } | |
26 | ||
27 | getVideoChannelDescription () { | |
28 | if (this.videoChannel.description) return this.videoChannel.description | |
29 | ||
b1d40cff | 30 | return this.i18n('No description') |
170726f5 C |
31 | } |
32 | } |