Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Close window in node-webkit using AngularJS

How to close window using AngularJs and node-webkit ? I don't want to use funcionality of windows.close() when navigathing through app.

like image 348
Sysrq147 Avatar asked Apr 27 '14 20:04

Sysrq147


1 Answers

you'll want to use node-webkit's native API to access the window Object ... node-webkit Window API

var gui = require('nw.gui');
var win = gui.Window.get();

var app = angular.module('myApp', []);

app.controller('homeCtrl', ["$scope", function ($scope) {
    $scope.close = function() {
       win.close(); 
    };
}]);
like image 59
stukennedy Avatar answered Oct 12 '22 21:10

stukennedy