aboutsummaryrefslogblamecommitdiffhomepage
path: root/client/src/app/+video-channels/video-channel-about/video-channel-about.component.ts
blob: 5d435708e92ad44bf224545dfbb8f6354ca8914d (plain) (tree)































                                                                                     
import { Component, OnInit } from '@angular/core'
import { ActivatedRoute } from '@angular/router'
import 'rxjs/add/observable/from'
import 'rxjs/add/operator/concatAll'
import { VideoChannelService } from '@app/shared/video-channel/video-channel.service'
import { VideoChannel } from '@app/shared/video-channel/video-channel.model'

@Component({
  selector: 'my-video-channel-about',
  templateUrl: './video-channel-about.component.html',
  styleUrls: [ './video-channel-about.component.scss' ]
})
export class VideoChannelAboutComponent implements OnInit {
  videoChannel: VideoChannel

  constructor (
    protected route: ActivatedRoute,
    private videoChannelService: VideoChannelService
  ) { }

  ngOnInit () {
    // Parent get the video channel for us
    this.videoChannelService.videoChannelLoaded
      .subscribe(videoChannel => this.videoChannel = videoChannel)
  }

  getVideoChannelDescription () {
    if (this.videoChannel.description) return this.videoChannel.description

    return 'No description'
  }
}