Skip to content

Instantly share code, notes, and snippets.

@BoeseB
Last active March 18, 2016 08:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BoeseB/0fb5cd35ec1ca538c774 to your computer and use it in GitHub Desktop.
Save BoeseB/0fb5cd35ec1ca538c774 to your computer and use it in GitHub Desktop.
var remote = require('remote'); //'remote' is a node module of edge, and i need to resolve it with the require Method defined in module.js of node
export class EdgeTest
{
private edge = remote.require('electron-edge')
myInput = 'TypeScript';
myResult = '';
private helloWorld = this.edge.func(
`async (input) => { return ".NET Welcomes " + input.ToString();}`
);
submit() {
this.helloWorld(this.myInput, function(error, result) {
if(error) throw error;
this.myResult = result;
});
}
}
define(["require", "exports"], function (require, exports) {
"use strict";
var remote = require('remote'); //Here require is overwritten and fails to load the module
var EdgeTest = (function () {
function EdgeTest() {
this.edge = remote.require('electron-edge');
this.myInput = 'TypeScript';
this.myResult = '';
this.helloWorld = this.edge.func("async (input) => { return \".NET Welcomes \" + input.ToString();}");
}
EdgeTest.prototype.submit = function () {
this.helloWorld(this.myInput, function (error, result) {
if (error)
throw error;
this.myResult = result;
});
};
return EdgeTest;
}());
exports.EdgeTest = EdgeTest;
});
var remote = require('remote');
define(["require", "exports"], function (require, exports) {
"use strict";
var EdgeTest = (function () {
function EdgeTest() {
this.edge = remote.require('electron-edge');
this.myInput = 'TypeScript';
this.myResult = '';
this.helloWorld = this.edge.func("async (input) => { return \".NET Welcomes \" + input.ToString();}");
}
EdgeTest.prototype.submit = function () {
this.helloWorld(this.myInput, function (error, result) {
if (error)
throw error;
this.myResult = result;
});
};
return EdgeTest;
}());
exports.EdgeTest = EdgeTest;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment