ngx-electron | A simple Angular wrapper for electron 's Renderer API
kandi X-RAY | ngx-electron Summary
kandi X-RAY | ngx-electron Summary
Checkout the introduction post on my blog for more details.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of ngx-electron
ngx-electron Key Features
ngx-electron Examples and Code Snippets
Community Discussions
Trending Discussions on ngx-electron
QUESTION
I'm beginning with electron & angular.
I'm trying to execute an external application. Let's say pks.exe that is in c:\kube\
I did not find clearly if there is a way of doing that. I tried with ngx-electron library. I can open something like notepad or a word document using the openPath api. But it has not the the aim of executing something (and even more with parameters) just opening a file, just like if I clicked twice on it.
I also saw people speaking of child_process. But I don't managed to have it working with angular. It seems it is only working with nodejs.
Is there a solution ?
...ANSWER
Answered 2020-Dec-25 at 22:06Ok so basically to answer in a bit more detail:
Electrun is a multi process architecture. Basically, there are 2 processes, the main processes
which is a nodeJS process and the renderer process
which is a BrowserWindow running chromium. https://www.electronjs.org/docs/tutorial/application-architecture#differences-between-main-process-and-renderer-process
Angular runs in the renderer
. Since that is basically browser environment you can only perform javascript code that also works in a normal browser context. In a browser you can not perform scripts that directly open an application on your PC or something like a shell script. That would be a security nightmare (imagine visiting a website which could then execute arbitrary scripts on your PC. they could just run rm -rf /
or open like e.g. 1000 instances of word.exe
). You can indirectly open some apps with mailto:
or tel:
links etc...
Since the main
process is running nodeJS, you can include standard nodeJS libraries like child_process
https://nodejs.org/api/child_process.html.
So to get stuff working for you:
In your code, you should forward the request to open the external application from the renderer
(angular) process to the main
(nodeJS) process. Checkout https://www.electronjs.org/docs/api/ipc-main and https://www.electronjs.org/docs/api/ipc-renderer on how to do that specifically.
Angular (some service.ts
or component.ts
)
QUESTION
I am facing issues with electron-angular (totally angular beginner here) ipc events. Here is my code:
Electronhelper.service.ts
...ANSWER
Answered 2020-May-25 at 13:26You can fetch the settings synchronously, often an option if loading (and blocking) doesn't take too long:
QUESTION
I have an android 9 app recently converted to Electron app. For DataTable, I have enabled Print and Excel options. Excel upload is fine and exporting data. But Print is not working. Its giving the following error
...ANSWER
Answered 2020-Feb-15 at 08:31The information given in the post helped me ( angular application build in electron print a div shows blank window ).
The answer is : in main.ts for electron, need to add nativeWindowOpen: true as below.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install ngx-electron
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page