60 lines
1.4 KiB
TypeScript
60 lines
1.4 KiB
TypeScript
import { Component, OnInit} 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';
|
|
|
|
declare var $ :any;
|
|
@Component({
|
|
selector: 'app-root',
|
|
templateUrl: './app.component.html',
|
|
styleUrls: ['./app.component.css'],
|
|
providers: []
|
|
})
|
|
export class AppComponent implements OnInit {
|
|
|
|
fields: any[];
|
|
|
|
sliderExpanded : boolean = false;
|
|
|
|
constructor(private tokenService : TokenService, private router: Router) {
|
|
|
|
}
|
|
|
|
ngOnInit() {
|
|
|
|
}
|
|
|
|
|
|
|
|
slideNav(){
|
|
|
|
$("#appSidebar").toggleClass("expanded");
|
|
$("#appBody").toggleClass("expanded");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//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*/ }});
|
|
}
|
|
|
|
|
|
}
|
|
|