[ALOY-1602] Avoid some global variables to be only available in parent controller.
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2018-02-07T00:23:12.000+0000 |
Affected Version/s | n/a |
Fix Version/s | CLI Release 7.0.3 |
Components | Tooling |
Labels | n/a |
Reporter | Hans Knöchel |
Assignee | Bruce Wayne |
Created | 2018-02-01T15:36:12.000+0000 |
Updated | 2018-04-11T21:30:54.000+0000 |
Description
Quote from [Github](https://github.com/appcelerator/alloy/pull/859):
{quote}
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:
Is ALOY-897 no longer a problem? Checking git blame seems to show that's why this was done, I'm not well versed in widgets enough to know whether this is a known thing developers handle or not, the few widgets I checked on gitt.io seem to handle removing some of the properties
Verified the fix in alloy 1.12.0 in core 7.0.3-master.36. Closing.