1 import { Component, OnInit, OnDestroy } 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 import { Subscription } from 'rxjs'
9 selector: 'my-account-about',
10 templateUrl: './account-about.component.html',
11 styleUrls: [ './account-about.component.scss' ]
13 export class AccountAboutComponent implements OnInit, OnDestroy {
16 private accountSub: Subscription
19 private route: ActivatedRoute,
21 private accountService: AccountService
25 // Parent get the account for us
26 this.accountSub = this.accountService.accountLoaded
27 .subscribe(account => this.account = account)
31 if (this.accountSub) this.accountSub.unsubscribe()
34 getAccountDescription () {
35 if (this.account.description) return this.account.description
37 return this.i18n('No description')