zgo/src/app/viewer/viewer.component.ts

48 lines
1.4 KiB
TypeScript
Raw Normal View History

2021-10-20 20:51:14 +00:00
import { Component, OnInit, OnDestroy } from '@angular/core';
2021-10-15 19:14:49 +00:00
import { CanActivate, Router, RouterStateSnapshot, ActivatedRouteSnapshot } from '@angular/router';
2021-10-20 20:51:14 +00:00
import { MatDialog, MatDialogConfig } from '@angular/material/dialog';
2021-10-15 19:14:49 +00:00
import { UserService } from '../user.service';
import { FullnodeService } from '../fullnode.service';
2021-10-21 21:23:33 +00:00
import { ItemService } from '../items/items.service';
//import { NameDialogComponent } from '../namedialog/namedialog.component'; // TODO: connect dialog
import { Subscription, Observable } from 'rxjs';
2021-10-20 20:51:14 +00:00
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;
2021-10-15 19:14:49 +00:00
@Component({
selector: 'app-viewer',
templateUrl: './viewer.component.html',
styleUrls: ['./viewer.component.css']
})
export class ViewerComponent implements OnInit {
2021-10-20 20:51:14 +00:00
public message: string = "Welcome to the inside!";
public addrUpdate: Observable<string>;
2021-10-21 19:29:04 +00:00
public ownerUpdate: Observable<Owner>;
2021-10-20 20:51:14 +00:00
2021-10-15 19:14:49 +00:00
constructor(
public fullnodeService: FullnodeService,
private router: Router,
2021-10-20 20:51:14 +00:00
public userService: UserService,
private dialog: MatDialog
2021-10-15 19:14:49 +00:00
){
this.addrUpdate = fullnodeService.addrUpdate;
2021-10-21 19:29:04 +00:00
this.ownerUpdate = userService.ownerUpdate;
2021-10-15 19:14:49 +00:00
}
ngOnInit(){
2021-10-21 19:29:04 +00:00
this.ownerUpdate.subscribe((owner) => {
this.message = owner.name;
});
2021-10-15 19:14:49 +00:00
}
ngOnDestroy(){
}
2021-10-20 20:51:14 +00:00
2021-10-15 19:14:49 +00:00
}