ledger
This commit is contained in:
@ -1,4 +1,8 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { AccountService } from '../data-object-service';
|
||||
import { Account } from '../data-objects';
|
||||
import { ExtApiService } from '../ext-data-object-service';
|
||||
import { MessageService } from '../message.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-ledger',
|
||||
@ -7,9 +11,27 @@ import { Component, OnInit } from '@angular/core';
|
||||
})
|
||||
export class LedgerComponent implements OnInit {
|
||||
|
||||
constructor() { }
|
||||
account: Account
|
||||
accountId: number
|
||||
|
||||
ngOnInit(): void {
|
||||
constructor(
|
||||
private extApiService: ExtApiService,
|
||||
private messageService: MessageService
|
||||
) { }
|
||||
|
||||
async getAccount(): Promise<void> {
|
||||
try {
|
||||
this.messageService.add("Trying to load ledger account")
|
||||
this.account = await this.extApiService.getAccountByDescription('Ledger')
|
||||
this.messageService.add("Account loaded")
|
||||
} catch (err) {
|
||||
this.messageService.add(JSON.stringify(err, undefined, 4))
|
||||
}
|
||||
}
|
||||
|
||||
async ngOnInit(): Promise<void> {
|
||||
await this.getAccount()
|
||||
this.accountId = this.account.id
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user