9
저는 Nodes.js 멍청한 놈입니다. 모듈 구조에 대해 머리를 쓰려고합니다. 내가 thusly 히 testFunc() 메서드를 호출하려고모듈 내보내기 클래스 Nodes.js
var testModule = {
input : "",
testFunc : function() {
return "You said: " + input;
}
}
exports.test = testModule;
: 지금까지 내가 모듈 (testMod.js)이이 클래스의 구조를 정의해야
var test = require("testMod");
test.input = "Hello World";
console.log(test.testFunc);
그러나 나는 형식 오류 얻을 :
을TypeError: Object #<Object> has no method 'test'
나는 무엇을 잘못하고 있니?
감사합니다. – travega