import { Router } from '@angular/router';
import { UserService } from './auth/user.service';
import { AppConfig } from './app-config.interface';
import { APP_CONFIG } from './app-config';
import { Component, OnInit, Inject } from '@angular/core';
@Component({
selector: 'app-root',
template: `
`,
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'Byteflies';
constructor(@Inject(APP_CONFIG) config: AppConfig, public user: UserService, private router: Router) {
this.title = config.title;
window['user'] = this.user;
}
logout() {
this.user.logout();
this.router.navigate(['auth', 'login']);
}
}