Forum Discussion
rraghvani
Champion Level 3
Could you upload both of your codes again, as it doesn't seem to be correctly formatted.
"That does not seem to work for the Class" - what exactly have you tried?
cmpenn
9 months agoContributor
Oh yeah...something really went wrong with those.
As for what I tried...I tried exporting the class, and I've tried requiring the class. I even tried following the module format to see if that would do anything...but I got errors that the constructor could not be called.
The Class File
class MainClass{
constructor() {
}
Start() {
}
Close() {
}
}
module.exports = {MainApp: MainClass}
The file calling the class
var main = require("Main");
const mainApp = new main.MainApp();
mainApp.Start();
Related Content
- 8 years ago
- 3 years ago
- 8 years ago
- 8 years ago
Recent Discussions
- 7 hours ago