]>
Commit | Line | Data |
---|---|---|
db400f44 C |
1 | import { Component, OnInit } from '@angular/core' |
2 | import { ActivatedRoute } from '@angular/router' | |
0626e7af C |
3 | import { Account } from '@app/shared/account/account.model' |
4 | import { AccountService } from '@app/shared/account/account.service' | |
b1d40cff | 5 | import { I18n } from '@ngx-translate/i18n-polyfill' |
0626e7af C |
6 | |
7 | @Component({ | |
8 | selector: 'my-account-about', | |
9 | templateUrl: './account-about.component.html', | |
10 | styleUrls: [ './account-about.component.scss' ] | |
11 | }) | |
12 | export class AccountAboutComponent implements OnInit { | |
6b738c7a | 13 | account: Account |
0626e7af C |
14 | |
15 | constructor ( | |
b1d40cff C |
16 | private route: ActivatedRoute, |
17 | private i18n: I18n, | |
0626e7af C |
18 | private accountService: AccountService |
19 | ) { } | |
20 | ||
21 | ngOnInit () { | |
22 | // Parent get the account for us | |
23 | this.accountService.accountLoaded | |
24 | .subscribe(account => this.account = account) | |
25 | } | |
26 | ||
27 | getAccountDescription () { | |
28 | if (this.account.description) return this.account.description | |
29 | ||
b1d40cff | 30 | return this.i18n('No description') |
0626e7af C |
31 | } |
32 | } |