aboutsummaryrefslogblamecommitdiffhomepage
path: root/client/src/app/+account/account.component.ts
blob: d936ce2fe0d3ae8ac1ddd91971ba6d5eb62d4407 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11










                                                                    
                  











                                                                           
 
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({
  selector: 'my-account',
  templateUrl: './account.component.html',
  styleUrls: [ './account.component.scss' ]
})
export class AccountComponent implements OnInit {
  account: Account

  constructor (
    private route: ActivatedRoute,
    private accountService: AccountService
  ) {}

  ngOnInit () {
    const accountId = parseInt(this.route.snapshot.params['accountId'], 10)

    this.accountService.getAccount(accountId)
        .subscribe(account => this.account = account)
  }
}