import { Component , OnInit } from '@angular/core' ; import { ElectronService } from './core/electron.service' ; import { TranslateService } from '@ngx-translate/core' ; import { GlobalStatusService } from './global/globalStatus.service' ; import { GlobalSettingService } from './global/globalSetting.service' ; import { GameService } from './core/game.service' ; import { Langs } from './core/languageList' ; import { HotkeyService } from './core/hotkey.service' ; @ Component ( { selector : 'app-root' , templateUrl : './app.component.html' , styleUrls : [ './app.component.scss' ] } ) export class AppComponent { constructor ( public electronService , private translate , private globalStatusService , private globalSettingService , private gameService , private hotkeyService ) { translate . addLangs ( Langs ) ; translate . setDefaultLang ( 'cn' ) ; translate . use ( 'cn' ) ; globalSettingService . Init ( ) ; if ( electronService . isElectron ( ) ) { console . log ( 'Mode electron' ) ; console . log ( 'electron is correctly injected?' , electronService . ipcRenderer ) ; console . log ( 'nodeJs childProcess is correctly injected?' , electronService . childProcess ) ; } else { console . log ( 'Mode web' ) ; } } }