aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+video-channels/video-channels.component.ts
blob: 5eca64fb55697e9c1c71c2250edbb807869d20d1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { Component, OnInit } from '@angular/core'
import { ActivatedRoute } from '@angular/router'
import { VideoChannel } from '@app/shared/video-channel/video-channel.model'
import { VideoChannelService } from '@app/shared/video-channel/video-channel.service'

@Component({
  templateUrl: './video-channels.component.html',
  styleUrls: [ './video-channels.component.scss' ]
})
export class VideoChannelsComponent implements OnInit {
  videoChannel: VideoChannel

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

  ngOnInit () {
    const videoChannelId = this.route.snapshot.params['videoChannelId']

    this.videoChannelService.getVideoChannel(videoChannelId)
        .subscribe(videoChannel => this.videoChannel = videoChannel)
  }
}