]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/app/+accounts/account-video-channels/account-video-channels.component.ts
Fix markdown links truncating
[github/Chocobozzz/PeerTube.git] / client / src / app / +accounts / account-video-channels / account-video-channels.component.ts
CommitLineData
d3e91a5f
C
1import { Component, OnInit } from '@angular/core'
2import { ActivatedRoute } from '@angular/router'
d3e91a5f
C
3import { Account } from '@app/shared/account/account.model'
4import { AccountService } from '@app/shared/account/account.service'
5import { VideoChannel } from '../../../../../shared/models/videos'
6import { VideoChannelService } from '@app/shared/video-channel/video-channel.service'
db400f44 7import { flatMap, map, tap } from 'rxjs/operators'
d3e91a5f
C
8
9@Component({
10 selector: 'my-account-video-channels',
11 templateUrl: './account-video-channels.component.html',
12 styleUrls: [ './account-video-channels.component.scss' ]
13})
14export class AccountVideoChannelsComponent implements OnInit {
15 account: Account
16 videoChannels: VideoChannel[] = []
17
18 constructor (
19 protected route: ActivatedRoute,
20 private accountService: AccountService,
21 private videoChannelService: VideoChannelService
22 ) { }
23
24 ngOnInit () {
25 // Parent get the account for us
26 this.accountService.accountLoaded
db400f44
C
27 .pipe(
28 tap(account => this.account = account),
ad9e39fb 29 flatMap(account => this.videoChannelService.listAccountVideoChannels(account)),
db400f44
C
30 map(res => res.data)
31 )
d3e91a5f
C
32 .subscribe(videoChannels => this.videoChannels = videoChannels)
33 }
34}