I have found that we can create generic JS modules instead of normal or web (see Ti Titanium folders and search. Cloud module) but there can not be any document that tells it ...
So I tried to add my own commonsense module inside titanium folder "General" and using "requirement" Imported it into my application. It moves like a charm.
Now, I want to add some other files in my normalJS module and I want to refer to each other within the module.
For example, in my app I have:
- main.js
- UI
- Generalview.js
In this structure, main.js is my main module and there is a method in COMMONView () that is module normalview (required ('./ui / CommonView') ) But the compiler complains that the module is not found.
How do I create a normal JS module with another module?
To be precise, I do not want to copy these modules inside my project. I want to put them in titanium folders so this is available for all projects.
Here's a blog post from talking about apocalypse about the CommonJes module: < P> And here is the guide / documentation from applicationcaster:
Now, all module reference applications are relative to root:
- In commonView.js, in chief;
- requires main.js ('UI / CommonView')
- UI / SpecificView ')
and Packaged CommonJes Module (Such as ti.cloud, installed in the "module" directory of your application or application support) only support a single javascript file.
Hint: I found these guides typing "Appcelerator CommonJS" in Google, I'm not sure what method you used to find the document. "Requirement" has also been widely documented in the "Global" object in titanium mobile document:
- Generalview.js
Comments
Post a Comment