Hi all,
Please see my below example:
//METHOD 1 //windows.js exports.Window = function(e){ return Ti.UI.createWindow(e); }; //app.js var UI = require('window'); var win = UI.Window({backgroundColor:'#999'}); win.open(); //METHOD 2 //windows.js function create_window(e){ return Ti.UI.createWindow(e); } //app.js Ti.include('windows.js'); // This Ti.include will be deprecated, so any other way to include a js file? var win = create_window({backgroundColor:'#999'}); win.open();Base on http://docs.appcelerator.com/titanium/3.0/#!/guide/Coding_Best_Practices-section-30082362_CodingBestPractices-Deferscriptloading we should follow method 1. But what is the different here? Actually the two methods are same each other, why we need to follow method 1?
Another small question is "Ti.include will be deprecated, so any other way to include a js file?"
Thank you so much for all your help!