angular-electron | Electron Platform for Angular | Reactive Programming library
kandi X-RAY | angular-electron Summary
kandi X-RAY | angular-electron Summary
Electron Platform for Angular 2. Work in progress.
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 angular-electron
angular-electron Key Features
angular-electron Examples and Code Snippets
Community Discussions
Trending Discussions on angular-electron
QUESTION
So I’m very new to Angular and Electron, and I've been having difficulties getting things to work. I've been looking for sample apps so that I could have a starting point that I could understand, and I came across this: https://developer.okta.com/blog/2019/03/20/build-desktop-app-with-angular-electron
I've been following it, and at the point where I first run npm run electron
the window opens but stays empty, and in the devtools console I find Uncaught TypeError: window.require is not a function
.
I had made just some minor adjustments (making some types explicit) because initially it wouldn't compile, but nothing that should change anything about this.
I have done some searches and for what I understand it might have something to do with
...ANSWER
Answered 2021-Mar-21 at 10:13It seems to me that if you use this code instead of the other code, it might work:
QUESTION
I have an Angular project run with Electron. My code compiles and works nicely, and now I've come to test it. Before I even start writing tests, all the 'shouldCreate'
tests are failing with the message "TypeError: window.require is not a function"
.
I have seen this post and this post, as well as a few others on the matter, but none of them address what to do if it only fails in tests.
How can I get my tests to succeed, even with my code having things like window.require('fs')
and the like? Again, the code compiles and runs (at least in the dev environment) but my tests fail before I have written them
TIA
EDIT: My code is based off of this github project
...ANSWER
Answered 2020-Nov-19 at 12:59So it seems like those errors appeared because I opened the browser to the port where karma was running, and as a result, those errors appeared. (Chrome really does not have access to the window etc, so it makes sense.)
When I ran the tests from the CMD w/o opening the browser, everything succeeded and all's well that ends well
QUESTION
I searched a lot of posts and also the official Angular documentation, but I'm not able to get an AngularJS service running in Angular. I finally came to this page https://angular.io/api/upgrade/static/UpgradeModule#examples which seems to explain exactly what I need, but when doing all those steps I'm getting:
ERROR Error: Trying to get the AngularJS injector before it being set.
My impression is that this example is not quite complete. E.g. there is no hint were the (old) AngularJS framework must be loaded. My service looks like angular.module('my-module').service('my-service', ...
thus angular
needs to be defined, otherwise I'm getting an error. Furthermore many examples assume that the AngularJS code is written in TypeScript. In my case this is not true (just plain Javascript).
Unfortunately with Angular 9 there is an additional issue with the @angular/upgrade
module which is not mentioned anywhere and can only be solved by disabling the new Ivy compiler in tsconfig.app.json
, otherwise the compiler will throw Error: Error on worker #1: Error: getInternalNameOfClass() called on a non-ES5 class: expected UpgradeComponent to have an inner class declaration
:
ANSWER
Answered 2020-Jul-05 at 22:50I had this same error and I solved it in my app, however I cannot remember exactly why this was happening (sorry, it was a long time ago). I wasn't upgrading services, instead I was downgrading.
Here's my app.module.ts I've added comments to the parts that were critical to get this working, I hope there may be a hint for you here. Note that I used the Angular CLI to generate the app.
QUESTION
I'm creating a desktop version of an angular app, for that I'm using electron.
Opening main window is quite easy:
...ANSWER
Answered 2018-May-23 at 21:09I'm not sure I understand exactly where is the problem, but i think you could try implementing UrlSerializer
compatible with file:///
protocol and file names or atleast check DefaultUrlSerializer
implementation.
QUESTION
I am using Angular 8 for my Angular-Electron application. I have a field as API-Key stored in a tabular format which is quite sensitive and needs to be shown to user on user's account page. The problem is it needs to be shown as a password text-field. Whenever user will click on a button called "Show", the API-key would be visible for a few seconds perhaps or until user clicks the button again. It cannot be shown as an input field.
This is how the user account details are shown to user:
...ANSWER
Answered 2020-Apr-02 at 07:51The fastest solution is create function and write function in html.
QUESTION
Compiling my Angular Electron app gives Error: ENOENT: no such file or directory, open 'node_modules/@angular-devkit/build-angular/src/angular-cli-files/_models/webpack-configs/browser.js'
. The app does compile and run. The problem emerged after running npm install
.
My node-modules
has ../angular-cli-files/models/..
, containing browser.js
. Weirdly, an underscore is prepended, ie _models
, in the error message. I'm completely at a loss why this happens. I've tried the suggestions in several SO answers Could not find module "@angular-devkit/build-angular"; Cannot find module 'webpack' - Angular and others, but no luck. My search didn't find any examples with an underscore being prepended.
package.json
:
ANSWER
Answered 2019-Nov-19 at 18:04Turned out, the part /models/
in the path 'node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs/browser.js'
in postinstall.js
and postinstall-web.js
somehow changed to /_models/
. I've no idea how this happened, as I'd never opened those files.
Changing it back solved the problem.
QUESTION
I'm trying to set up my application with Electron for the first time. The initial steps of adding main.js, changing the index.html, changing the package.json are done. While I try to run the application using the command npm run electron-build
, I get a screen as below.
Error-while-running-electron-app
I'm not able to run my application. It isn't an error basically, but just lack of information. Any help regarding this will be much appreciated. TIA.
main.js
...ANSWER
Answered 2019-Aug-29 at 14:00Use loadFile with local resources
win.loadFile(filePath[, options])
QUESTION
Im creating a desktop app using angular-electron
I'm using electron-builder
for packaging that supports auto updates with electron-updater
Everything is working by calling the functions from the entry point main.ts
ANSWER
Answered 2019-Aug-25 at 02:46It was remote.require('electron-updater').autoUpdater.checkForUpdates()
QUESTION
I'm using angular-electron to build a windows desktop application with angular 7 and electron 4. Now I would like to externalise a specific folder(let's say config
folder) at the root of the unpacked build. There are a lot of files inside config folder used in the application and which could be edited by the final user
Here is the unpacked structure I want:
How to manage this ?
...ANSWER
Answered 2019-May-30 at 20:29In the electron-builder.json
under the build
section add
QUESTION
In my angular-electron app I use mat-tab-group, in every tab i load the same instance of a component.
I have two ways to create new Tabs: - one by clicking a button in the component which holds the mat-tab-group - the second one is triggered via an IPC message.
Both ways call the same function, where I push a new object to an array, the tabs are created via *ngFor on this array.
The effect:
While the "second" tab created by the clicked button behaves normally, the one triggered via IPC ("third") does not:
The ripple effect is shown right on the click on the "third"-tab, but the click event on the tab (selectedTabChange) is only triggered when i click a second time somewhere in the window. Also, the content of the tab (wrapped in an ng-template) is changed only after the second click.
Both, the component which holds the tabs as well as the one which is instantiated in every tab, use push strategy in change detection.
I am pretty sure that this has something to do with ngZones, but I am not sure how I could solve this problem. Thanks for any help!
Animated Gif here:
Code HTML:
...ANSWER
Answered 2019-Feb-04 at 20:42Wow, that was way easier than I thought:
Turns out that because of the subscription to the Electron Service, the code ran outside the NgZone and it stayed there.
I found out because I inserted this in the called function: console.log(NgZone.isInAngularZone());
The same function returned one time true, one time false on this, depending on how I called it.
The solution was really straightforward:
In the subscription to the electron service, I now call the createTab function like this: this.ngZone.run(() => this.createNewTab());
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install angular-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