[AC-3162] Offer the way to share common utilities and helper functions across all files inside that directory
GitHub Issue | n/a |
Type | New Feature |
Priority | n/a |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2015-07-04T00:27:20.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Alloy |
Labels | TCSupportTriage, feature |
Reporter | David He |
Assignee | Mauro Parra-Miranda |
Created | 2014-10-15T22:23:54.000+0000 |
Updated | 2016-03-08T07:57:33.000+0000 |
Description
Get inspired by Node.js which uses index.js to serve sharing across files inside the directory. See attached screenshot where shared stuff defined in index.js will be available to all three files in the red square.
This would be helpful if I have multiple helper functions to require in any file inside a specific directory but they should not be in the Alloy.Globals.
Attachments
Hello! You can add this kind of objects inside the lib directory. Then you can do a require from any place: http://docs.appcelerator.com/titanium/3.0/#!/guide/Alloy_Controllers Please let me know if that works for you. Best Regards, Mauro
Hi Mauro I know I can achieve this via that way. But, I just think it would be better to share common files using my way. Anyway, I will see how your recommendation goes. Thanks You can now close this ticket.