如何从methodTwo调用methodOne?
有没有安全正确的方法?
$(document).ready(function () {
var classOne = new ClassOne();
var classTwo = new ClassTwo();
});
var ClassOne = (function (window, document, Math, undefined) {
function ClassOne () {
}
ClassOne.prototype = {
methodOne: function () {
console.log('method one');
}
};
return ClassOne;
})(window, document, Math, undefined);
var ClassTwo = (function (window, document, Math, undefined) {
function ClassTwo () {
}
ClassTwo.prototype = {
methodTwo: function () {
// how to call?
// classOne.methodOne()
}
};
return ClassTwo;
})(window, document, Math, undefined);