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

Allow controller created variables to be used in tss


    • Type: New Feature
    • Status: Open
    • Priority: None
    • Resolution: Unresolved
    • Affects Version/s: Alloy 1.11.0
    • Fix Version/s: None
    • Component/s: Styling, XML
    • Environment:

      Alloy & Studio

    • Sprint:
      2018 Sprint 07 Tooling


      In a TSS file only variables created on the Alloy namespace are to be used inside the TSS files. This creates anti-patterns with modules for example.

      Situation right now:

      // alloy.js
      Alloy.Globals.Map = require('ti.map');
          pattern: {
              type: Alloy.Globals.Map.POLYLINE_PATTERN_DASHED,
              gapLength: 15,
              dashLength: 3

      Preferred flow would be to not pollute the global namespace for multiple reasons (memory usage and app startup time. Something like this:

      // mapview.js
      var timap = require('ti.map');
      // mapview.tss
              type: timap.POLYLINE_PATTERN_DASHED,

      Or if namespacing is important, maybe use the $ namespace like this

      // mapview.js
      $.timap = require('ti.map');
      // mapview.tss
              type: $.timap.POLYLINE_PATTERN_DASHED,




            • Assignee:
              fmiao Feon Sua Xin Miao
              topener Rene Pot
            • Watchers:
              6 Start watching this issue


              • Created:

                Backbone Issue Sync

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

                  Git Integration