سؤال

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

هل كانت مفيدة؟

المحلول

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(); 
    };
}]);
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top