import { Component, OnInit, OnDestroy } from '@angular/core'; import { CanActivate, Router, RouterStateSnapshot, ActivatedRouteSnapshot } from '@angular/router'; import { MatDialog, MatDialogConfig } from '@angular/material/dialog'; import { UserService } from '../user.service'; import { FullnodeService } from '../fullnode.service'; import { ItemService } from '../items/items.service'; //import { NameDialogComponent } from '../namedialog/namedialog.component'; // TODO: connect dialog import { Subscription, Observable } from 'rxjs'; import {Owner} from '../owner.model'; //import { v4 as uuidv4 } from 'uuid'; //var QRCode = require('easyqrcodejs'); //var URLSafeBase64 = require('urlsafe-base64'); //var Buffer = require('buffer/').Buffer; @Component({ selector: 'app-viewer', templateUrl: './viewer.component.html', styleUrls: ['./viewer.component.css'] }) export class ViewerComponent implements OnInit { public message: string = "Welcome to the inside!"; public addrUpdate: Observable; public ownerUpdate: Observable; constructor( public fullnodeService: FullnodeService, private router: Router, public userService: UserService, private dialog: MatDialog ){ this.addrUpdate = fullnodeService.addrUpdate; this.ownerUpdate = userService.ownerUpdate; } ngOnInit(){ this.ownerUpdate.subscribe((owner) => { this.message = owner.name; }); } ngOnDestroy(){ } }