fix/ use node 3rd party libraries in renderer process
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,8 @@ export class DetailComponent implements OnInit {
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit(): void { }
|
||||
ngOnInit(): void {
|
||||
console.log("DetailComponent INIT");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -10,6 +10,8 @@ export class HomeComponent implements OnInit {
|
||||
|
||||
constructor(private router: Router) { }
|
||||
|
||||
ngOnInit(): void { }
|
||||
ngOnInit(): void {
|
||||
console.log("HomeComponent INIT");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,5 +8,7 @@ import { Component, OnInit } from '@angular/core';
|
||||
export class PageNotFoundComponent implements OnInit {
|
||||
constructor() {}
|
||||
|
||||
ngOnInit(): void {}
|
||||
ngOnInit(): void {
|
||||
console.log("PageNotFoundComponent INIT");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user