X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=webapp%2Fsrc%2Fapp%2Fapp.component.ts;h=f858b0c4b2c8e811241d73d0dd494a7c7243bc08;hb=38c0c21a969e621c725245ce91c78e77076c5ce7;hp=b644ecd3b7b9a35016c07ef415a474d989b52a9f;hpb=b0d130807fb9bf36f5ac1abe21cbd558eb86d5cc;p=src%2Fxds%2Fxds-agent.git diff --git a/webapp/src/app/app.component.ts b/webapp/src/app/app.component.ts index b644ecd..f858b0c 100644 --- a/webapp/src/app/app.component.ts +++ b/webapp/src/app/app.component.ts @@ -1,44 +1,21 @@ -import { Component, OnInit, OnDestroy } from '@angular/core'; -import { TranslateService } from '@ngx-translate/core'; -import { ConfigService, IConfig } from './services/config.service'; +/** + * @license + * Copyright Akveo. All Rights Reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + */ +import { Component, OnInit } from '@angular/core'; +import { AnalyticsService } from './@core/utils/analytics.service'; @Component({ - selector: 'app-root', - templateUrl: 'app.component.html' + selector: 'ngx-app', + template: '', }) +export class AppComponent implements OnInit { -export class AppComponent implements OnInit, OnDestroy { - private defaultLanguage = 'en'; - public isCollapsed = true; + constructor(private analytics: AnalyticsService) { + } - constructor(private translate: TranslateService, private configSvr: ConfigService) { - } - - ngOnInit() { - this.translate.addLangs(['en', 'fr']); - this.translate.setDefaultLang(this.defaultLanguage); - - const browserLang = this.translate.getBrowserLang(); - this.translate.use(browserLang.match(/en|fr/) ? browserLang : this.defaultLanguage); - - this.configSvr.Conf$.subscribe((cfg: IConfig) => { - let lang: string; - switch (cfg.language) { - case 'ENG': - lang = 'en'; - break; - case 'FRA': - lang = 'fr'; - break; - default: - lang = this.defaultLanguage; - } - this.translate.use(lang); - }); - } - - ngOnDestroy(): void { - // this.aglIdentityService.loginResponse.unsubscribe(); - // this.aglIdentityService.logoutResponse.unsubscribe(); - } + ngOnInit(): void { + this.analytics.trackPageViews(); + } }