import { Component, OnInit } from '@angular/core'; import { StorageService } from 'src/app/services/storage.service'; import { THIS_EXPR } from '@angular/compiler/src/output/output_ast'; import { LoadAlertsService } from 'src/app/services/load-alerts.service'; import { RouterService } from 'src/app/services/router.service'; import { Platform } from '@ionic/angular'; @Component({ selector: 'app-dashboard', templateUrl: './dashboard.page.html', styleUrls: ['./dashboard.page.scss'], }) export class DashboardPage implements OnInit { Introduction:string=`Our product is an Internet Service Provider (its called ΩSPEED, and is a section of a bigger company or group called ΩMEGA SMART SYSTEMS). We aim to provide free internet WIFI access for the public in a specific zone called ΩSPOT (Subscribers to ΩSPEED and NON-subscribers) as soon as the current situation ends... Consequently, we need a mobile application to organize access. On the second hand, the application will be a platform for customer services and advertising our products.`; constructor( private plt:Platform, private router:RouterService, private loadAlertsService:LoadAlertsService, private storage:StorageService ) { } get lang(){ return this.Lang; } Lang;//1:eng/2 :ar Header=""; get header(){ return this.Header; } //Please Choose Your Language/الرجاء اختيار اللغة ionViewWillEnter(){ this.plt.ready().then(() => { this.plt.backButton.subscribeWithPriority(9999999, () => { this.router.exitApp(); }) }); this.storage.get("IsFirstLogin").then( data=>{ if(data==null) { this.loadAlertsService.PresentAlert('Introduction:',"Welcome",this.Introduction); } }, error=>{ console.log(error,"error"); } ); this.storage.get("lang").then(data=>{console.log(data,'lang'); if(data==undefined) { this.Header='Please Choose Your Language/الرجاء اختيار اللغة'; } }, error=>{console.log(error);}); } ChangeLang(val){ this.storage.set("lang",val); this.storage.set("IsFirstLogin",1); this.Lang=val; if(val==2) { document.dir='rtl' this.router.navByUrl("auth"); } else { document.dir='ltr' this.router.navByUrl("auth"); } console.log(this.Header); } ionViewWillLeave(){ this.plt.ready().then(() => { this.plt.backButton.subscribeWithPriority(9999999, () => { this.router.goBack(); }) }); } ngOnInit() { } }