Page MenuHomec4science

app.component.ts
No OneTemporary

File Metadata

Created
Sun, Apr 28, 15:59

app.component.ts

import {Component, OnInit} from '@angular/core';
import { Router } from '@angular/router';
import {AuthenticationService} from './_services';
import {WebSocketAPI} from './_helpers/WebSocketAPI';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit {
currentUser: any;
currentUserValue: any;
webSocketAPI: WebSocketAPI;
greeting: any;
name: string;
ngOnInit() {
this.authenticationService.currentUser.subscribe(x => this.currentUser = x);
this.currentUserValue = this.authenticationService.currentUserValue;
}
constructor(private authenticationService: AuthenticationService, private router: Router) {
}
refresh(x) {
this.currentUser = x;
}
logout() {
this.authenticationService.logout();
this.router.navigate(['/']);
}
}

Event Timeline