ref/ set default angular eslint rules
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { ElectronService } from './core/services';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { AppConfig } from '../environments/environment';
|
||||
import { APP_CONFIG } from '../environments/environment';
|
||||
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
@@ -14,7 +14,7 @@ export class AppComponent {
|
||||
private translate: TranslateService
|
||||
) {
|
||||
this.translate.setDefaultLang('en');
|
||||
console.log('AppConfig', AppConfig);
|
||||
console.log('APP_CONFIG', APP_CONFIG);
|
||||
|
||||
if (electronService.isElectron) {
|
||||
console.log(process.env);
|
||||
|
||||
@@ -17,9 +17,7 @@ import { DetailModule } from './detail/detail.module';
|
||||
import { AppComponent } from './app.component';
|
||||
|
||||
// AoT requires an exported function for factories
|
||||
export function HttpLoaderFactory(http: HttpClient): TranslateHttpLoader {
|
||||
return new TranslateHttpLoader(http, './assets/i18n/', '.json');
|
||||
}
|
||||
const httpLoaderFactory = (http: HttpClient): TranslateHttpLoader => new TranslateHttpLoader(http, './assets/i18n/', '.json');
|
||||
|
||||
@NgModule({
|
||||
declarations: [AppComponent],
|
||||
@@ -35,7 +33,7 @@ export function HttpLoaderFactory(http: HttpClient): TranslateHttpLoader {
|
||||
TranslateModule.forRoot({
|
||||
loader: {
|
||||
provide: TranslateLoader,
|
||||
useFactory: HttpLoaderFactory,
|
||||
useFactory: httpLoaderFactory,
|
||||
deps: [HttpClient]
|
||||
}
|
||||
})
|
||||
|
||||
@@ -30,7 +30,8 @@ export class ElectronService {
|
||||
this.childProcess = window.require('child_process');
|
||||
this.fs = window.require('fs');
|
||||
|
||||
// If you want to use a NodeJS 3rd party deps in Renderer process (like @electron/remote), it must be declared in dependencies of both package.json (in root and app folders)
|
||||
// If you want to use a NodeJS 3rd party deps in Renderer process (like @electron/remote),
|
||||
// it must be declared in dependencies of both package.json (in root and app folders)
|
||||
// If you want to use remote object in renderer process, please set enableRemoteModule to true in main.ts
|
||||
this.remote = window.require('@electron/remote');
|
||||
console.log('remote - globalShortcut', this.remote.globalShortcut);
|
||||
|
||||
@@ -10,7 +10,7 @@ export class DetailComponent implements OnInit {
|
||||
constructor() { }
|
||||
|
||||
ngOnInit(): void {
|
||||
console.log("DetailComponent INIT");
|
||||
console.log('DetailComponent INIT');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -10,8 +10,8 @@ export class HomeComponent implements OnInit {
|
||||
|
||||
constructor(private router: Router) { }
|
||||
|
||||
ngOnInit(): void {
|
||||
console.log("HomeComponent INIT");
|
||||
ngOnInit(): void {
|
||||
console.log('HomeComponent INIT');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,6 +9,6 @@ export class PageNotFoundComponent implements OnInit {
|
||||
constructor() {}
|
||||
|
||||
ngOnInit(): void {
|
||||
console.log("PageNotFoundComponent INIT");
|
||||
console.log('PageNotFoundComponent INIT');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export const AppConfig = {
|
||||
export const APP_CONFIG = {
|
||||
production: false,
|
||||
environment: 'DEV'
|
||||
};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export const AppConfig = {
|
||||
export const APP_CONFIG = {
|
||||
production: true,
|
||||
environment: 'PROD'
|
||||
};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export const AppConfig = {
|
||||
export const APP_CONFIG = {
|
||||
production: false,
|
||||
environment: 'LOCAL'
|
||||
};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export const AppConfig = {
|
||||
export const APP_CONFIG = {
|
||||
production: false,
|
||||
environment: 'WEB'
|
||||
};
|
||||
|
||||
@@ -2,9 +2,9 @@ import { enableProdMode } from '@angular/core';
|
||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||
|
||||
import { AppModule } from './app/app.module';
|
||||
import { AppConfig } from './environments/environment';
|
||||
import { APP_CONFIG } from './environments/environment';
|
||||
|
||||
if (AppConfig.production) {
|
||||
if (APP_CONFIG.production) {
|
||||
enableProdMode();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user