Uploaded image for project: 'Appcelerator - INBOX'
  1. Appcelerator - INBOX
  2. AC-5083

Liveview: Alloy.Globals undefined in 2nd run

    Details

      Description

      When I run an app with Alloy.Globals defined in alloy.js I get an undefined is not an object error when the liveview updates for the first time. The first compile run is working fine.

      index.js

      console.log(Alloy.Globals.device.height + " - " + Alloy.Globals.device.width);
      $.index.open();
      

      index.xml

      <Alloy>
      	<Window class="container">
      	</Window>
      </Alloy>
      

      alloy.js

      Alloy.Globals.device = {
      	height: 100,
      	width: 100
      }
      

      Output

       [INFO]  test_liveview/1.0 (6.1.1.c28220a)
       [LiveView]  Client connected
       [INFO]  100 100
       [LiveView]  Alloy recompile initiated for ios
       [LiveView]  Reload Triggered
         REASON:  File Changed
         FILE:  /Users/Development/test_liveview/app/controllers/index.js
       [LiveView]  Reload Triggered
         REASON:  File Changed
         FILE:  /Users/Development/test_liveview/Resources/iphone/alloy/sync/sql.js
      [INFO]  [LiveView] Reloading App
      [INFO]  UI SHUTDOWN COMPLETE. TRYING TO RESUME RESTART
      [INFO]  test_liveview/1.0 (6.1.1.c28220a)
       [LiveView]  Client connected
       [LiveView]  Client disconnected
       [INFO]  [LiveView] Error Evaluating app.js @ Line: 28
       [ERROR] TypeError: undefined is not an object (evaluating 'Alloy.Globals.device.height')
       [ERROR] File: app.js
       [ERROR] Line: 28
       [ERROR] SourceId: <null>
       [ERROR] Backtrace:
       [ERROR]  undefined
      

      Ti SDK 6.1.1.GA
      Liveview iOS Simulator

        Attachments

          Activity

            People

            • Assignee:
              shossain Shak Hossain (Inactive)
              Reporter:
              michael Michael Gangolf
            • Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Git Integration