fix/ use node 3rd party libraries in renderer process

This commit is contained in:
Maxime GRIS
2021-06-19 17:05:30 +02:00
parent 2e292321c5
commit 1fb08a7457
11 changed files with 1172 additions and 764 deletions

View File

@@ -27,12 +27,13 @@ export class ElectronService {
this.ipcRenderer = window.require('electron').ipcRenderer;
this.webFrame = window.require('electron').webFrame;
// 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);
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 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);
}
}
}

View File

@@ -9,6 +9,8 @@ export class DetailComponent implements OnInit {
constructor() { }
ngOnInit(): void { }
ngOnInit(): void {
console.log("DetailComponent INIT");
}
}

View File

@@ -10,6 +10,8 @@ export class HomeComponent implements OnInit {
constructor(private router: Router) { }
ngOnInit(): void { }
ngOnInit(): void {
console.log("HomeComponent INIT");
}
}

View File

@@ -8,5 +8,7 @@ import { Component, OnInit } from '@angular/core';
export class PageNotFoundComponent implements OnInit {
constructor() {}
ngOnInit(): void {}
ngOnInit(): void {
console.log("PageNotFoundComponent INIT");
}
}