VICE / Client / src / app / app.component.ts
app.component.ts
Raw
import { Component, OnInit } from '@angular/core';
import { Subscription } from 'rxjs';
import { AuthenticationService, AuthLevel } from './authentication.service';
import { RoleService, Roles } from './role.service';
import { ServerDataService } from './server-data.service';


@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit {

  public auth: AuthLevel = AuthLevel.None;
  public auths = AuthLevel;

  constructor(private authenticationService: AuthenticationService,
              private roleService: RoleService, private dataService: ServerDataService) {}


  ngOnInit() {
    this.authenticationService.status.subscribe( (result: AuthLevel) => {
      this.auth = result;
      console.log(result)
    });

  }


}