Uploaded image for project: 'Alloy'
  1. Alloy
  2. ALOY-794

Alloy Conditional code not functional

    Details

      Description

      Q&A: http://developer.appcelerator.com/question/156082/alloy-compiler-conditional-code-not-work

      Add code below in a controller code:

      if(OS_ANDROID) {
      	function aaa() {
      		Ti.API.info('android aaa');
      	}
      }
      else {
      	function bbb() {
      		Ti.API.info('not android bbb');
      	}
      }
       
      if(OS_IOS) {
      	function aaa() {
      		Ti.API.info('ios aaa');
      	}
      }
      else {
      	function bbb() {
      		Ti.API.info('not ios bbb');
      	}
      }
       
      setTimeout(aaa, 0);
      setTimeout(bbb, 0);
      

      The compiled code is:

          function aaa() {
              Ti.API.info("android aaa");
          }
          function bbb() {
              Ti.API.info("not android bbb");
          }
          function aaa() {
              Ti.API.info("ios aaa");
          }
          function bbb() {
              Ti.API.info("not ios bbb");
          }
          setTimeout(aaa, 0);
          setTimeout(bbb, 0);
      

        Attachments

          Activity

            People

            • Assignee:
              tlukasavage Tony Lukasavage
              Reporter:
              aladdina Mason Zhang
            • Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                  Git Integration