]>
Commit | Line | Data |
---|---|---|
1 | import { Component, OnInit } from '@angular/core' | |
2 | import { ActivatedRoute } from '@angular/router' | |
3 | import { Account } from '@app/shared/account/account.model' | |
4 | import { AccountService } from '@app/shared/account/account.service' | |
5 | import { I18n } from '@ngx-translate/i18n-polyfill' | |
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 { | |
13 | account: Account | |
14 | ||
15 | constructor ( | |
16 | private route: ActivatedRoute, | |
17 | private i18n: I18n, | |
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 | ||
30 | return this.i18n('No description') | |
31 | } | |
32 | } |