I am new to angular , electron.
I am trying to use type script component functions/variables in main.js.
I have LicesneController component which holds emailId, I want to call some methods at the time of tool closure which required emailId(stored in loginCompoenent).
I tried several ways to achieve this :
const { LicenseController } = require('./src/lib/LicenseController');
: giving Exception as Cann't find moduleQuestion is :
I have resolved this scenario by using win.webContents.send and ipc renderer.
I was trying to call typescript methods from main.js
in main.js:
win.webContents.send('On Close');
in typeScript : app.component.ts :
ipcr: IpcRenderer;
ngOnInit() {
this.ipcr = window.ipcRenderer;
this.ipcr.on('On Close', (event, arg) => {
// Do Some stuff here
});
}