argos/dmp-frontend/src/app/app.component.ts

43 lines
1.1 KiB
TypeScript

import { Component } from '@angular/core';
import { ServerService } from './services/server.service';
import { FieldBase } from '../app/form/fields/field-base';
import { JsonObjest } from '../app/entities/JsonObject.class';
import { TokenService, TokenProvider } from './services/login/token.service';
import { Router, CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
import { MainSignInComponent } from './login/main-sign-in/main-sign-in.component';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
providers: []
})
export class AppComponent {
fields: any[];
constructor(private tokenService : TokenService, private router: Router) {
}
//loggedInAs : string = null;
showLogin : boolean = false;
login(){
//redirect to login page
this.router.navigate(['/login'], { queryParams: { /*returnUrl: this.state.url*/ }});
}
logout(){
this.tokenService.logout();
this.router.navigate(['/login'], { queryParams: { /*returnUrl: this.state.url*/ }});
}
}