Last active
March 18, 2016 08:49
-
-
Save BoeseB/0fb5cd35ec1ca538c774 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
}); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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