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
    );
  }

}