2023-01-31 03:17:40 +00:00
|
|
|
import { Component, OnInit } from '@angular/core';
|
|
|
|
import { LanguageService } from './language.service';
|
|
|
|
import { LanguageData } from './language.model';
|
|
|
|
|
2021-10-20 20:51:14 +00:00
|
|
|
//import { Post} from './posts/post.model';
|
2021-10-01 20:10:14 +00:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'app-root',
|
|
|
|
templateUrl: './app.component.html',
|
|
|
|
styleUrls: ['./app.component.css']
|
|
|
|
})
|
2022-07-22 04:06:23 +00:00
|
|
|
|
2021-10-01 20:10:14 +00:00
|
|
|
export class AppComponent {
|
2023-01-31 03:17:40 +00:00
|
|
|
|
|
|
|
title = 'ZGo';
|
|
|
|
|
|
|
|
zgoLanguage:string = '';
|
|
|
|
vE = {
|
|
|
|
mainPriceData : ''
|
|
|
|
}
|
|
|
|
|
|
|
|
constructor(
|
|
|
|
private languageService: LanguageService){
|
|
|
|
}
|
|
|
|
|
|
|
|
ngOnInit(){
|
|
|
|
console.log('chgUILanguage() called on ngOnInit ');
|
|
|
|
this.chgUILanguage();
|
|
|
|
}
|
|
|
|
|
|
|
|
chgUILanguage() {
|
|
|
|
console.log('MAIN.chgUILanguage Called ');
|
|
|
|
this.languageService.getViewElements('main').subscribe(
|
|
|
|
response => {
|
|
|
|
console.log('response >> ', response );
|
|
|
|
console.log('main_price_data -> ',response.data.main_price_data);
|
|
|
|
this.vE.mainPriceData = response.data.main_price_data;
|
|
|
|
this.zgoLanguage = response.language;
|
|
|
|
},
|
|
|
|
error => { console.log('Error --> ',error); }
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
usFlagClicked() {
|
|
|
|
if ( this.zgoLanguage != 'en-US' ) {
|
|
|
|
localStorage.setItem('zgo_language','en-US');
|
|
|
|
window.location.reload();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
esFlagClicked() {
|
|
|
|
if ( this.zgoLanguage != 'es-US' ) {
|
|
|
|
localStorage.setItem('zgo_language','es-US');
|
|
|
|
window.location.reload();
|
|
|
|
}
|
|
|
|
}
|
2021-10-15 19:14:49 +00:00
|
|
|
|
2021-10-01 20:10:14 +00:00
|
|
|
}
|
2023-01-31 03:17:40 +00:00
|
|
|
|