Titanium JIRA Archive
Appcelerator Community (AC)

[AC-3162] Offer the way to share common utilities and helper functions across all files inside that directory

GitHub Issuen/a
TypeNew Feature
Priorityn/a
StatusClosed
ResolutionInvalid
Resolution Date2015-07-04T00:27:20.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAlloy
LabelsTCSupportTriage, feature
ReporterDavid He
AssigneeMauro Parra-Miranda
Created2014-10-15T22:23:54.000+0000
Updated2016-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

FileDateSize
D2EAF685-A15F-4AFF-BE0B-4BC3E69CC017.png2014-10-15T22:23:54.000+000052530

Comments

  1. Mauro Parra-Miranda 2014-10-16

    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
  2. David He 2014-10-30

    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.

JSON Source