Correct way of using multiple windows

You must Login before you can answer or comment on any questions.

[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.html
I 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?

— asked 12 months ago by James -
0 Comments

1 Answer

Your Answer

Think you can help? Login to answer this question!