Improved routing #130
This commit is contained in:
@@ -1,14 +1,21 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { PrimeNGConfig } from 'primeng/api';
|
||||
import { AuthService } from './services/auth/auth.service';
|
||||
import { SocketService } from './services/socket/socket.service';
|
||||
import { ThemeService } from './services/theme/theme.service';
|
||||
import { Component, OnInit } from "@angular/core";
|
||||
import { TranslateService } from "@ngx-translate/core";
|
||||
import { PrimeNGConfig } from "primeng/api";
|
||||
import { AuthService } from "./services/auth/auth.service";
|
||||
import { SocketService } from "./services/socket/socket.service";
|
||||
import { ThemeService } from "./services/theme/theme.service";
|
||||
import { ActivatedRoute, Router } from "@angular/router";
|
||||
import { SpinnerService } from "./services/spinner/spinner.service";
|
||||
import { DataService } from "./services/data/data.service";
|
||||
import { SidebarService } from "./services/sidebar/sidebar.service";
|
||||
import { Server } from "./models/data/server.model";
|
||||
import { Queries } from "./models/graphql/queries.model";
|
||||
import { Query } from "./models/graphql/query.model";
|
||||
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
templateUrl: './app.component.html',
|
||||
styleUrls: ['./app.component.scss']
|
||||
selector: "app-root",
|
||||
templateUrl: "./app.component.html",
|
||||
styleUrls: ["./app.component.scss"]
|
||||
})
|
||||
export class AppComponent implements OnInit {
|
||||
|
||||
@@ -22,7 +29,7 @@ export class AppComponent implements OnInit {
|
||||
private themeService: ThemeService,
|
||||
private socket: SocketService,
|
||||
private translateService: TranslateService,
|
||||
private config: PrimeNGConfig
|
||||
private config: PrimeNGConfig,
|
||||
) {
|
||||
this.themeService.sidebarWidth$.subscribe(value => {
|
||||
this.sidebarWidth = value;
|
||||
@@ -36,7 +43,7 @@ export class AppComponent implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.translateService.setDefaultLang('en');
|
||||
this.translateService.setDefaultLang("en");
|
||||
|
||||
this.themeService.loadTheme();
|
||||
this.socket.startSocket();
|
||||
@@ -45,7 +52,7 @@ export class AppComponent implements OnInit {
|
||||
loadLang(): void {
|
||||
let lang = localStorage.getItem(`default_lang`);
|
||||
if (!lang) {
|
||||
lang = 'en';
|
||||
lang = "en";
|
||||
this.setLang(lang);
|
||||
}
|
||||
this.translate(lang);
|
||||
@@ -57,7 +64,7 @@ export class AppComponent implements OnInit {
|
||||
|
||||
translate(lang: string) {
|
||||
this.translateService.use(lang);
|
||||
this.translateService.get('primeng').subscribe(res => this.config.setTranslation(res));
|
||||
this.translateService.get("primeng").subscribe(res => this.config.setTranslation(res));
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user