I'm using Electron to create a little desktop app and exporting with module.exports
. On the 'server' side this works fine. However, when I'm using module.exports on the front end, as per Electron docs, I get this error.
Uncaught TypeError: this.showProgressbar is not a function"
var ViewController = {
getPageCount: function (res) {
this.total = res;
this.showProgressbar(res);
},
showProgressBar: function (num) {
$('.progress-container').addClass('show');
$('.progress-bar').style('width', '0%');
}
};
module.exports = ViewController;
On the client side, this is how I'm accessing this file.
var view = require(__dirname + '/client/ViewController.js');
ipc.on('page_count', view.getPageCount);
How should I be accessing internal methods in this instance?