ngx-electronjs
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

ngx-electronjs

Angular electronjs wrapper service

Demo

Getting Started

1. Install packages

npm i electron ngx-electronjs

2. Import Module

import { NgxElectronModule } from 'ngx-electronjs';

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

3. Include the services

import { ElectronService, IpcRendererService } from 'ngx-electronjs';

export class AppComponent {

  constructor(
    private electron: ElectronService,
    private ipc: IpcRendererService
  ){}

  ngOnInit() {

    // Checks
    this.electron.isDefined();
    this.ipc.isDefined();

    // Static accessors
    this.electron.instance;
    this.ipc.instance;

    // IpcRenderer Shortcuts
    this.ipc.send('event');
    this.ipc.on('event').subscribe(eventData => ...);
  }

}

4. Run your electron app

ng build --prod && electron .

Readme

Keywords

none

Package Sidebar

Install

npm i ngx-electronjs

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

95.6 kB

Total Files

26

Last publish

Collaborators

  • aitorllj93