[INFO] iPhone Device family: iphone [INFO] iPhone SDK version: 5.0 [INFO] Projekt/1.0 (2.0.2.GA.2ff31a3)I am building an iOS app in Appcelerator and in this app I want to create a CommonJS module for UI components that I add to the global variable and then use it in other commonJS modules.
My code is based upon this example:
http://developer.appcelerator.com/blog/2011/09/forging-titanium-episode-6-a-single-context-tabbed-application-template.htmlI add it into app.js like this:
var globals = {}; globals.Components = require ('ui/Components'); I use it in other modules like this: var button_right = new globals.Components.NavBarButton ();Is this a good way of doing it?
1 Answer
Seems perfectly reasonable to me
Your Answer
Think you can help? Login to answer this question!