'Electron/Angular : How to use typescript component functions/variables in main.js

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 :

  1. Local and session storage: Not worked as they cannot be used at client side. : giving error as localStorage is not defined
  2. Include LicesneController module in main.js const { LicenseController } = require('./src/lib/LicenseController'); : giving Exception as Cann't find module

Question is :

  • why #2 is not working any reason (all the paths are correct) ?
  • Is there any other way to achieve this scenario ?
  • If we are using node local storage , how we can hold values set in ts file and use in js file for node local storage.


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source