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

Avoid some global variables to be only available in parent controller.

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: CLI Release 7.0.3
    • Component/s: Tooling
    • Labels:
      None
    • Story Points:
      1
    • Sprint:
      2018 Sprint 03 Tooling

      Description

      Quote from Github:

      I don't understand why it is necessary to remove "$model", "_parentSymbol" or "_itemTemplate" from the "arguments" variable.

      This is causing issues when passing "$model" for example to a controller which is inheriting from another controller as per Alloy Controller Inheritance documentation (http://docs.appcelerator.com/platform/latest/#!/guide/Alloy_Controllers-section-src-34636384_AlloyControllers-Inheritance).

      If we delete it from there, only the parent will have "$model" properly set but the child controller won't as it's deleted from "arguments".

      Another option would be to run "__processArg()" before calling the parent controller but this would mean only the child controller has `$model` properly set, it will be `null` for the parent one.

      In order to reproduce:

      1. index.js
        Alloy.createController('child', { $model: aBackboneModelObject });
      1. parent.js
        console.log(_.isNull($model)); // always return false
        ...
      1. child.js
        exports.baseController = "parent";
        console.log(_.isNull($model)); // always return true

        Attachments

          Activity

            People

            • Assignee:
              batman Bruce Wayne
              Reporter:
              hknoechel Hans Knöchel
            • 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 Source Code