How to access global value from commonJS module in Appcelerator?
问题 For long time I was creating apps by making global variable which was accessible via modules I load. var myApp = { windows: {} } myApp.windows.mainWindow = require('libs/pages/mainWindow').create(); myApp.windows.mainWindow.open(); By calling myApp.windows[windowName][functionName] I could manipulate other windows (for example update lists) from within the commonJS module. I could also close, open other windows I found that calling global variables from within commonJS module is not good