This is a simple application skeleton to create desktop application using AngularJS. This application is using node-webkit as our desktop host, bower to install client-side libraries as well as normal npm modules as supported by node-webkit.
define(['./module'], function(controllers) {
'use strict';
controllers.controller('MyCtrl', ['$scope', 'nwService', function($scope, nwService) {
// Minimize the main window
nwService.window.minimize();
// After 1 second, maximize the window
setTimeout(function(){nwService.window.maximize();}, 1000);
// When the window is closed, ask for confirmation before actually closing
nwService.window.on('close', function() {
if (confirm("Do you really want to close the window?"))
nwService.window.close(true);
});
}]);
});
Exposes
nw.gui
and main window.Example