[ALOY-515] Document constants used throughout alloy examples
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | High |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2013-02-12T13:29:13.000+0000 |
Affected Version/s | Alloy 0.3.6 |
Fix Version/s | 2013 Sprint 04 |
Components | Documentation |
Labels | SupportTeam |
Reporter | Eduardo Gomez |
Assignee | Tony Lukasavage |
Created | 2013-02-12T06:01:32.000+0000 |
Updated | 2014-06-22T13:21:07.000+0000 |
Description
Feature
Document constants used throughout alloy examples. From a default Alloy project use the following controller and global configuration file. *OS_ANDROID* will get through both iOS and Android platforms.app/config.json
{
"global": {},
"myKeys": { "key1": 1, "key2": 2},
"env:development": {},
"env:test": {},
"env:production": {},
"dependencies": {}
}
Controller
- app/controllers/index.js
function doClick(e) {
//alert($.label.text);
if(OS_ANDROID){
alert('it is android');
}else{
alert('it is not android');
}
}
$.index.open();
Comments
- Tony Lukasavage 2013-02-12 I can't reproduce this. Perhaps there's something wrong in the rest of the code you haven't shown. I created a new alloy project, used a simple index.xml and the index.js given above with the config.json. The OS_ANDROID conditional works exactly as expected, showing the appropriate alerts based on the platform. Tested with 0.3.x and 1.0.X branch of alloy and TiSDK 3.0.0.GA. Closing this ticket.