layout.component.ts 825 Bytes
Newer Older
1
2
3
4
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { GHCIService } from '../shared/services/ghci.service';
import { NotificacionService } from '../shared/services/notificacion.service';
5
6
import { TranslateService } from '@ngx-translate/core';

7
8
9
10
11
12
13
@Component({
    selector: 'app-layout',
    templateUrl: './layout.component.html',
    styleUrls: ['./layout.component.scss'],
    providers: [GHCIService]
})
export class LayoutComponent implements OnInit {
14
15
16
17
18
    translateService: any;

    constructor(public router: Router, public translate: TranslateService) {
        this.translateService = translate;
    }
19
20
    ngOnInit() {
        if (this.router.url === '/') {
21
            this.router.navigate(['/'+this.translateService.get('i18n.code').value+'/login']);
22
23
24
        }
    }
}