DEV Community

Discussion on: Build Desktop apps with the power of Angular

Collapse
 
nejetherington profile image
Nick Etherington • Edited

Hi Ahmed!

Thanks for the post.

I followed along until the part using ngx-electron but when I get to that part, I don't have access to process, or any other property on _electronService (they are all null). However, this._electronService.isElectronApp returns true so the app is running inside Electron.

On checking your Github repo I see it was updated recently and looks to no longer use ngx-electron? In addition the scripts are different in package.json, and the bin folder has disappeared with bin/main.ts being replaced by main.js.

Just wondering the reason for the changes - is it a problem with ngx-electron?

Collapse
 
ahmedmkamal profile image
Ahmed Kamal

Hi Nick!

It's good to hear that the issue has been solved 👍.

I updated the repo cause I was using Angular 7 and Electron 4 while writing this post and those are outdated now, and no, there's no problem withngx-electron` but we don't need it anymore with the latest versions of Angular and Electron.

I'm going to update this post very soon in order to be compatible with the latest versions of Angular and Electron, and I'm going to make the demo app actually does something instead of being a blank app, so, STAY TUNED 🚀.

Collapse
 
nejetherington profile image
Nick Etherington

Awesome, thanks Ahmed! Looking forward to the new demo app 👀 👍

Collapse
 
nejetherington profile image
Nick Etherington

EDIT: I solved the issue by updating my main.ts file to include webPreferences, as follows:

const { BrowserWindow } = require('electron')
let win = new BrowserWindow({
webPreferences: {
nodeIntegration: true
}
})