38 lines
915 B
TypeScript
38 lines
915 B
TypeScript
import { Component, OnInit } from '@angular/core';
|
|
import { TenantService } from '../data-object-service';
|
|
import { Tenant } from '../data-objects';
|
|
import { MessageService } from '../message.service';
|
|
|
|
@Component({
|
|
selector: 'app-enter-payment',
|
|
templateUrl: './enter-payment.component.html',
|
|
styleUrls: ['./enter-payment.component.css']
|
|
})
|
|
export class EnterPaymentComponent implements OnInit {
|
|
|
|
tenants: Tenant[]
|
|
accountId: number
|
|
|
|
constructor(
|
|
private tenantService: TenantService,
|
|
private messageService: MessageService
|
|
) { }
|
|
|
|
|
|
|
|
async getTenants(): Promise<void> {
|
|
try {
|
|
this.messageService.add("Trying to load tenants")
|
|
this.tenants = await this.tenantService.getTenants()
|
|
this.messageService.add("Tenants loaded")
|
|
} catch (err) {
|
|
this.messageService.add(JSON.stringify(err, undefined, 4))
|
|
}
|
|
}
|
|
|
|
ngOnInit(): void {
|
|
this.getTenants()
|
|
}
|
|
|
|
}
|