Created
May 2, 2012 21:28
-
-
Save QGao/2580655 to your computer and use it in GitHub Desktop.
How to organize a Titanium App.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-------content of app.js-------- | |
Ti.include('somefolder/platform.js'); | |
Ti.include('somefolder/API.js'); | |
Ti.include('somefolder/modules.js'); | |
Ti.include('somefolder/UI.js'); | |
MyApp = { | |
Platform:{}, | |
API:{}, | |
Modules:{}, | |
UI:{}, | |
}; | |
------------------------------ | |
------content of UI.js-------- | |
MyApp.UI=(function(){ | |
var API = {}; | |
API.foo = function(params){ | |
var foo = require('somefolder/UI/foo.js); | |
return foo; | |
}; | |
API.bar = function(params){ | |
var bar = require('somefolder/UI/bar.js); | |
return bar; | |
}; | |
return API; | |
})(); | |
--------------------- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment