Skip to content
Snippets Groups Projects
app.component.ts 655 B
Newer Older
wwwazz's avatar
wwwazz committed
import { Component } from '@angular/core';
import { Router } from '@angular/router';
import { UserAuthentifactionService } from './shared/user-authentifaction.service';
wwwazz's avatar
wwwazz committed

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.scss']
})
export class AppComponent {
  title = 'tp_user';

  isConnected = false;

  constructor(private router: Router, private authService: UserAuthentifactionService) {
    authService.isConnected.subscribe(connected => this.isConnected = connected);

  }

  goLogin() {
    this.router.navigate(["login"]);
  }

  disconnected() {
    this.authService.disconnect();
  }

wwwazz's avatar
wwwazz committed
}