]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/app/+video-channels/video-channel-about/video-channel-about.component.ts
6f862718f22acfb0e0cefbbe17a3927a423c2b19
[github/Chocobozzz/PeerTube.git] / client / src / app / +video-channels / video-channel-about / video-channel-about.component.ts
1 import { Component, OnInit } from '@angular/core'
2 import { ActivatedRoute } from '@angular/router'
3 import { VideoChannelService } from '@app/shared/video-channel/video-channel.service'
4 import { VideoChannel } from '@app/shared/video-channel/video-channel.model'
5
6 @Component({
7 selector: 'my-video-channel-about',
8 templateUrl: './video-channel-about.component.html',
9 styleUrls: [ './video-channel-about.component.scss' ]
10 })
11 export class VideoChannelAboutComponent implements OnInit {
12 videoChannel: VideoChannel
13
14 constructor (
15 protected route: ActivatedRoute,
16 private videoChannelService: VideoChannelService
17 ) { }
18
19 ngOnInit () {
20 // Parent get the video channel for us
21 this.videoChannelService.videoChannelLoaded
22 .subscribe(videoChannel => this.videoChannel = videoChannel)
23 }
24
25 getVideoChannelDescription () {
26 if (this.videoChannel.description) return this.videoChannel.description
27
28 return 'No description'
29 }
30 }