meerkat-java/bulletin-board-server-frontend/src/app/app.component.ts

31 lines
629 B
TypeScript
Raw Normal View History

import {Component, OnInit} from '@angular/core';
import {BBService} from "./bb.service"; // respectively "./node_modules/protobufjs"
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
providers: [BBService]
})
export class AppComponent implements OnInit {
title = 'Bulletin-Board Server';
status = 'Not connected';
errorMessage = '';
constructor(private bbservice : BBService) { }
ngOnInit(): void {
this.bbservice.getStatus().subscribe(
status => this.status = status.name,
error => this.errorMessage = <any>error
);
}
}