import {Component, OnInit, OnDestroy} from '@angular/core'; import { MatDialog, MatDialogConfig} from '@angular/material/dialog'; import {FullnodeService} from '../fullnode.service'; import { UserService } from '../user.service'; import {Subscription, Observable} from 'rxjs'; import {Owner} from '../owner.model'; @Component({ selector: 'app-header', templateUrl: './header.component.html', styleUrls: ['./header.component.css'] }) export class HeaderComponent implements OnInit, OnDestroy { public height = 0; private owner: Owner= { _id:'', address: 'none', name:'', currency: 'usd', tax: false, taxValue: 0, vat: false, vatValue: 0 }; private session: string | null = ''; public heightUpdate: Observable; public ownerUpdate: Observable; public uZaddrUpdate: Observable; constructor( public fullnodeService: FullnodeService, public userService: UserService, private dialog: MatDialog ){ this.heightUpdate = fullnodeService.heightUpdate; this.uZaddrUpdate = userService.uZaddrUpdate; this.ownerUpdate = userService.ownerUpdate; this.ownerUpdate.subscribe((owner) => { this.owner = owner; }); } ngOnInit(){ } ngOnDestroy(){ } getCurrency(){ return this.owner.currency.toUpperCase(); } }