]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/app/+video-channels/video-channel-about/video-channel-about.component.ts
5d435708e92ad44bf224545dfbb8f6354ca8914d
[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 'rxjs/add/observable/from'
4 import 'rxjs/add/operator/concatAll'
5 import { VideoChannelService } from '@app/shared/video-channel/video-channel.service'
6 import { VideoChannel } from '@app/shared/video-channel/video-channel.model'
7
8 @Component({
9 selector: 'my-video-channel-about',
10 templateUrl: './video-channel-about.component.html',
11 styleUrls: [ './video-channel-about.component.scss' ]
12 })
13 export class VideoChannelAboutComponent implements OnInit {
14 videoChannel: VideoChannel
15
16 constructor (
17 protected route: ActivatedRoute,
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
30 return 'No description'
31 }
32 }