47 lines
1.4 KiB
TypeScript
47 lines
1.4 KiB
TypeScript
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
|
|
import { Router, CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, ActivatedRoute, NavigationExtras } from '@angular/router';
|
|
import { TranslateService } from '@ngx-translate/core';
|
|
|
|
|
|
declare const gapi: any;
|
|
|
|
declare var $: any;
|
|
@Component({
|
|
selector: 'app-root',
|
|
templateUrl: './app.component.html',
|
|
styleUrls: ['./app.component.scss'],
|
|
providers: [],
|
|
encapsulation: ViewEncapsulation.None
|
|
})
|
|
export class AppComponent implements OnInit {
|
|
|
|
constructor(private router: Router, private route: ActivatedRoute, private translate: TranslateService) {
|
|
// this language will be used as a fallback when a translation isn't found in the current language
|
|
translate.setDefaultLang('en');
|
|
// the lang to use, if the lang isn't available, it will use the current loader to get them
|
|
translate.use('en');
|
|
|
|
}
|
|
|
|
ngOnInit() {
|
|
}
|
|
|
|
login() {
|
|
//redirect to login page
|
|
this.router.navigate(['/login'], { queryParams: { /*refresh : Math.random() ,returnUrl: this.state.url*/ } });
|
|
}
|
|
|
|
logout() {
|
|
|
|
}
|
|
|
|
goToDMPs() {
|
|
this.router.navigate(['/dmps'], { queryParams: { /*refresh : Math.random() ,returnUrl: this.state.url*/ } });
|
|
}
|
|
|
|
goToProjects() {
|
|
this.router.navigate(['/projects'], { queryParams: { /*refresh : Math.random() ,returnUrl: this.state.url*/ } });
|
|
}
|
|
}
|
|
|