Titanium JIRA Archive
Appcelerator Community (AC)

[AC-763] Alloy Global array reload issue

GitHub Issuen/a
TypeBug
Priorityn/a
StatusResolved
ResolutionCannot Reproduce
Resolution Date2015-09-30T03:02:06.000+0000
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
Labelsn/a
Reporteradam Kearsley
AssigneeShak Hossain
Created2015-05-11T08:12:37.000+0000
Updated2016-03-08T07:37:01.000+0000

Description

Steps to Reproduce

Create an array in alloy.js Alloy.Globals.myArray = []; in index.js add Ti.API.info(Alloy.Globals.myArray.length); Run the application. Close and re-run OR modify the app to make a live reload. RESULT: Error Alloy.Globals.myArray is undefined Editing the alloy.js file and saving it (forcing a reload) seems to pick the alloy file up again.

Actual Result

Error Alloy.Globals.myArray is undefined

Expected Result

[INFO] : 0

Attachments

FileDateSize
.log2015-05-11T08:12:42.000+00001156738
diagnostic4660403502053113491.log2015-05-11T08:12:48.000+000074479

Comments

  1. Rakhi Mitro 2015-08-25

    Hello, We have tested this issue in updated environment. It’s working as expected . *Test Environments:* CLI Version = 4.0.1 Titanium SDK Version = 4.1.0.GA Android: Google Galaxy Nexus - 4.1.1 - API 16 - 720x1280 Appc Studio: Appcelerator Studio, build: 4.1.1.201507141126 Alloy: 1.7.3 *Steps to Reproduce:* 1.Create an array in alloy.js 2.Create a button and add a click event on it in index.xml. 3.In index.js add Ti.API.info(Alloy.Globals.myArray.length) in function doClick. 4.Run the application. *Test code:* *alloy.js*
       var myArray = [];
       Alloy.Globals.myArray = myArray;
       
    *index.xml*
       <Alloy>
           <Window class="container" layout="vertical">
           
               <Button title="Click" onClick="doClick"></Button>
           </Window>
       </Alloy>
       
       
    *index.js*
       function doClick(e) {
       	
       	length =Alloy.Globals.myArray.length;
       	Ti.API.info('length is '+length);
       
       	
       } 
        
       $.index.open();
       
       
    *Test Result:* length is 0
       
       INFO] :   APSAnalyticsService: Analytics Service Started
       [INFO] :   APSAnalyticsService: Stopping Analytics Service
       [INFO] :   length is 0
       
       
    Thanks

JSON Source