angular-electron
angularjs helpers for electron apps
Installation
npm install angular-electron
bower install angular-electron
Use 0.1.x for electron < 0.35.0 and 0.2.x for electron > 0.35.0
Usage
angular;
API
renderer modules
These are all the renderer modules that are available as angular services:
desktopCapturer, ipcRenderer, webFrame, clipboard, crashReporter, nativeImage, screen, shell
To use them, simply inject them to your components:
angular;
remote and node modules
These are all the main modules that are available as angular services:
app, autoUpdater, BrowserWindow, contentTracing, dialog, globalShortcut, Menu, MenuItem, powerMonitor, powerSaveBlocker, protocol, webContents, tray
Node modules:
buffer, child_process, cluster, crypto, dns, events, fs, http, https, net, os, path, punycode, querystring, readline, stream, string_decoder, tls, dgram, url, util, v8, vm, zlib
All of the modules are lazy required (required only on use).
remoteProvider
In order to use a node package (e.g. moment), use the remoteProvider to register the package to an angular service.
angular;
or
angular;
then inject it as a regular service
angular;
or
angular;
You can also register a module by function:
angular;
then use it
angular;
process objects
electron process objects are available as angularjs constants.
angular;
current window
The current window is also available as angularjs constant.
angular;
current web contents
The current web contents module is also available as angularjs constant.
angular;
external link
This is a directive which opens a link in the default desktop browser.
googlegoogle
safe shutdown
safe shutdown is a service which handles pre-shudown actions.
angular;
The function can return a promise to handle async operations.
You can register multiple functions
Then use currentWindow.safeReload
or app.safeQuit
to reload/quit your app.
These methods are available only after safeShutdown is instantiated.