• Stars
    star
    428
  • Rank 101,481 (Top 2 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created over 7 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A simple Angular wrapper for electron's Renderer API

ngx-electron

Build Status semantic-release

ngx-electron is a small Module for Angular which makes calling Electron APIs from the Renderer Process easier. By adding it to your Angular project, you'll get IntelliSense and a simple Angular service which acts as facade for Electron APIs.

ngx-electron is licensed under MIT.

Introduction

Checkout the introduction post on my blog for more details.

Support me

Become a Patron!

Installation

ngx-electron can be installed easily using either yarn or npm commands in the scope of an angular project.

yarn add ngx-electron --save
# or
npm install ngx-electron --save

The NgxElectronModule needs to be import in your root Angular module (eg AppModule).

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app.component';

import { NgxElectronModule } from 'ngx-electron';


@NgModule({
    declarations: [],
    imports: [
      BrowserModule,
      NgxElectronModule
    ],
    bootstrap: [AppComponent]
})
export class AppModule {

}

Once the module has been imported, you can easily use dependency injection to get an instance of ElectronService.

import { Component } from '@angular/core';
import { ElectronService } from 'ngx-electron';

@Component({
  selector: 'my-app',
  templateUrl: 'app.html'
})
export class AppComponent {

    constructor(private _electronService: ElectronService) { }

    public playPingPong() {
        if(this._electronService.isElectronApp) {
            let pong: string = this._electronService.ipcRenderer.sendSync('ping');
            console.log(pong);
        }
    }
}

ElectronService

The ElectronService is exposing all API's accessible from within Electron's renderer process. If your app is not running inside electron, all getters will return NULL instead.

Properties

  • desktopCapturer: Electron.DesktopCapturer - Electron's desktop capturing API
  • ipcRenderer: Electron.IpcRenderer - Electron IpcRenderer
  • remote: Electron.Remote - Electron Remote capabilities
  • webFrame: Electron.WebFrame - Electron WebFrame
  • clipboard: Electron.Clipboard - Clipboard API
  • crashReporter: Electron.CrashReporter - Electron's CrashReporter
  • process: NodeJS.Process - Electron's Process Object
  • screen: Electron.Screen - Electron's Screen API
  • shell: Electron.Shell - Electron's Shell API
  • nativeImage: Electron.NativeImage - Electron's NativeImage API
  • isElectronApp: boolean - Indicates if app is being executed inside of electron or not
  • isMacOS: boolean - Indicates if app is running in electron and on macOS
  • isWindows: boolean - Indicates if app is running in electron and on Windows
  • isLinux: boolean - Indicates if app is running in electron and on Linux
  • isX86: boolean - Indicates if app is running in electron and on a x86 architecture
  • isX64: boolean - Indicates if app is running in electron and on a x64 architecture
  • isArm: boolean - Indiciates it app is running in electron adn on a ARM architecture

More Repositories

1

electron-angular-es6

Sample Electron App using AngularJS / SystemJS / BabelJS
JavaScript
105
star
2

azure-container-apps-samples

A collection of Azure Container Apps samples
Bicep
57
star
3

electron-ngx-sample

Angular2 Cross Platform Desktop App using TypeScript and Electron
TypeScript
36
star
4

aks-demo-app

Sample Application for AKS demonstrations
C#
31
star
5

electron-es2015-ng2

Tech Demo Angular, ES2015 and Electron
CSS
21
star
6

generator-sp2013-bootstrap3

SharePoint 2013 MasterPage and PageLayout generator for yeoman using Boostrap3
CoffeeScript
15
star
7

stringer

Go
13
star
8

generator-bower

yeoman generator for bower components
JavaScript
11
star
9

angular-i18n-by-example

Placeholder repository for upcoming print article
TypeScript
9
star
10

wasmio-2024-demos

Samples for demonstrating WebAssembly Component Model at Wasm I/O 2024
Rust
9
star
11

terraform-guide-for-azure-enthusiasts

HCL
8
star
12

restify-headstart

JavaScript
7
star
13

terraform-azurerm-state-backend

Terraform module which creates an Azure based state backend
HCL
6
star
14

spin-crud-mysql

Spin application to demonstrate data persistence in MySQL
Rust
6
star
15

rusty-grpc

Rust
6
star
16

kubernetes-samples

Collection of k8s samples
C#
6
star
17

dotfiles

Thorsten Hans's dotfiles
Shell
5
star
18

terraform-vs-bicep

Comparing a simple Azure architecture in Terraform and Bicep
Shell
5
star
19

currency-calculator-office-addin

Currency Calculator Add-In for Microsoft Excel
TypeScript
4
star
20

spin-htmx

A sample to demonstrate how to use HTMX with Spin
Rust
4
star
21

helm3-docker

Docker Image shipping helm3 and kubectl
Dockerfile
3
star
22

functions-with-go

Go
3
star
23

azure-container-apps-bicep

C#
3
star
24

krustlet-at-rust-linz

Rust
3
star
25

espc2019-terraform

Terraform Samples from ESPC2019
HCL
3
star
26

boardz

Cross Platform Sample with Cordova / Electron / Office / Offline Support
Shell
3
star
27

JsonPatch.Contrib

C#
3
star
28

spin-contrib-http

A rust crate providing a set of helpers to build HTTP apps with Fermyon Spin
Rust
3
star
29

six-steps-to-aks

C#
3
star
30

aca-traffic-split

Traffic Split in Azure Container Apps
Bicep
2
star
31

FluentSPRibbon

SharePoint2010 Ribbon DSL
C#
2
star
32

mask

A simple CLI to hide sensitive information from STDOUT
Go
2
star
33

bridge-to-kubernetes-demo

Sample app to demonstrate Bridge to Kubernetes
Go
2
star
34

awesome-tech-conferences

A list of upcoming tech conferences
HTML
2
star
35

slidev-theme-thinktecture

A slidev theme for @thinktecture
CSS
2
star
36

vscode-code-to-image

TypeScript
2
star
37

ai-conversations-with-spin-and-fermyon-cloud

Rust
2
star
38

hugo-spin

Template repository for building Hugo sites and serve them with Fermyon Spin
Makefile
2
star
39

terraform-webinar-azure-meetup-ffm

Samples from the Azure Meetup Frankfurt Webinar on Terraform
HCL
1
star
40

ThorstenHans

Go
1
star
41

tf-aks-with-nat-gateway

HCL
1
star
42

terraforming-aks

Shell
1
star
43

espc-2019-webinar

ESPC2019 - Azure Week - Terraform Webinar Samples
HCL
1
star
44

tf-actions

HCL
1
star
45

api-summit-2019-terraform

HCL
1
star
46

sharecoffeebook

ShareCoffee ebook
JavaScript
1
star
47

aks-keyvault

Sample to demonstrate reading sensitve data from Key Vault using Azure AD Pod Identity
Dockerfile
1
star
48

terraform-modules

HCL
1
star
49

Electron-Tales-from-the-Field

JavaScript
1
star
50

osm-sample-application

Sample application to explain Open Service Mesh
C#
1
star
51

basta-2018-office-addins-serverless

TypeScript
1
star
52

spin-to-slack

Rust
1
star
53

opentelemetry-sample

C#
1
star
54

spin-plugin-check-for-update

Rust
1
star
55

go-advent

My contribution to Go Advent Calendar 2021
Go
1
star
56

real-world-dockerimages-for-net-apps

Dockerfile
1
star
57

electron-memento

Simple module to track position and dimension of an electron window across an application lifecycle
TypeScript
1
star
58

check-aca-arm-namespace-migration

GitHub Action to check if your Azure Container Apps are migrated to new ARM namespaces
Go
1
star
59

jade-introduction

HTML
1
star
60

WebAssembly-beyond-the-browser

Shell
1
star
61

boardz-app

TypeScript
1
star
62

global-azure-2019-stuttgart

HCL
1
star
63

azure-saturday-berlin-2019

My demos from Azure Saturday Berlin 2019
HCL
1
star
64

xplatform-build

BaaS - Build as a Service
JavaScript
1
star
65

terraform-vmss-law-vminsights

HCL
1
star
66

docker-community-all-hands-september-2022

Dockerfile
1
star
67

porter-sample-terraform-aks

Porter / CNAB sample using Terraform, AKS, and Helm
C#
1
star
68

SharePoint.Jasmine

Jasmine Spec runner for SharePoint Apps
JavaScript
1
star
69

spin-compose

Python
1
star
70

hotreloading-configuration-data-using-kubernetes-configmaps

C#
1
star
71

rust-lib-wasm

Rust
1
star