0
我有一個具有常用功能的小型庫。它的結構是這樣的:這在Javascript中的模塊模式中
var $MY_APP = (function() {
return {
GROUP1: {
method1 : function(){ console.log("Test"); },
method2 : function(){}
},
GROUP2: {
method1 : function(){ },
method2 : function(){}
},
GROUPX: {
method1 : function(){ $MY_APP.GROUP1.method1(); },
method2 : function(){}
},
}
})();
是否有可能從GROUPX的任何方法調用另一個組方法,而不像在這個例子中那樣?
$MY_APP.utils.GROUP1.method1();
霍伊在這種情況下趕上這個?可能嗎?