Titanium JIRA Archive
Alloy (ALOY)

[ALOY-515] Document constants used throughout alloy examples

GitHub Issuen/a
TypeNew Feature
PriorityHigh
StatusClosed
ResolutionInvalid
Resolution Date2013-02-12T13:29:13.000+0000
Affected Version/sAlloy 0.3.6
Fix Version/s2013 Sprint 04
ComponentsDocumentation
LabelsSupportTeam
ReporterEduardo Gomez
AssigneeTony Lukasavage
Created2013-02-12T06:01:32.000+0000
Updated2014-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

  1. 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.

JSON Source