PeerTube/client/src/app/+accounts/accounts.component.ts

25 lines
692 B
TypeScript
Raw Normal View History

2018-04-24 08:10:54 -05:00
import { Component, OnInit } from '@angular/core'
import { ActivatedRoute } from '@angular/router'
import { AccountService } from '@app/shared/account/account.service'
import { Account } from '@app/shared/account/account.model'
@Component({
2018-04-25 09:56:13 -05:00
templateUrl: './accounts.component.html',
styleUrls: [ './accounts.component.scss' ]
2018-04-24 08:10:54 -05:00
})
2018-04-25 09:56:13 -05:00
export class AccountsComponent implements OnInit {
2018-04-25 03:21:38 -05:00
account: Account
2018-04-24 08:10:54 -05:00
constructor (
private route: ActivatedRoute,
private accountService: AccountService
) {}
ngOnInit () {
const accountId = this.route.snapshot.params['accountId']
2018-04-24 08:10:54 -05:00
this.accountService.getAccount(accountId)
.subscribe(account => this.account = account)
}
}