angular-electron icon indicating copy to clipboard operation
angular-electron copied to clipboard

Is it any way to make electron-remote package to work?

Open sanchezpablo opened this issue 8 years ago • 4 comments

Hi, I'm trying to make electron-remote package to work with this boilerplate, but no luck, I'm receiving error:

cannot find module x

when calling:

requireTaskPool(require.resolve(path_to_module))

anyone can help? thanks!

sanchezpablo avatar Jul 04 '18 10:07 sanchezpablo

what are you trying to accomplish with electron-remote ?

Kaffiend avatar Aug 09 '18 14:08 Kaffiend

Hi, I was testing different approaches in order to execute background tasks asynchronously (specially native module execution) and electron-remote seemed to be a good choice, but found that error and stopped.

sanchezpablo avatar Aug 10 '18 06:08 sanchezpablo

Hi,

Can you share us how do you import electron-remote package ? Is your module correctly imported in the project ? Maybe it's not be correctly imported by typescript during build phase ?

belnadris avatar Aug 19 '18 12:08 belnadris

In the Angular environment, it's recommended to use the dependency injection method to access ElectronService, which in turn provides the electron-remote API. Example:

constructor(
  private electronService: ElectronService
) {
  this.myObject = this.electronService.remote.require('package');
}

mauris avatar Aug 24 '18 20:08 mauris