Titanium JIRA Archive
Alloy (ALOY)

[ALOY-1346] Controller template should no longer declare args variable

GitHub Issuen/a
TypeImprovement
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2016-01-07T21:17:54.000+0000
Affected Version/sAlloy 1.6.0, alloy 1.7.31
Fix Version/sRelease 5.2.0, alloy 1.7.31, alloy 1.7.32
ComponentsSamples & Templates
Labelsn/a
ReporterFokke Zandbergen
AssigneeBruce Wayne
Created2016-01-06T15:54:07.000+0000
Updated2016-01-20T22:47:02.000+0000

Description

Since Alloy 1.6.0 (by ALOY-1092) the compiled controllers [have the following line](https://github.com/appcelerator/alloy/blob/master/Alloy/template/component.js#L20):
	this.args = arguments[0] || {};
	// ..
	var $ = this;
Still, our [template for new controllers](https://github.com/appcelerator/alloy/blob/master/Alloy/template/controller.js) has:
var args = arguments[0] || {};
Clearly this is no longer needed. The template can be emptied and the availability of $.args should be documented. I'll create a separate TIDOC ticket for that.

Comments

  1. Fokke Zandbergen 2016-01-06

    PR: https://github.com/appcelerator/alloy/pull/749
  2. Steve Rogers 2016-01-07

    Is this possible https://community.appcelerator.com/topic/4499/user-definable-alloy-templates
  3. Fokke Zandbergen 2016-01-07

    [~magnatronus] Right now it's hard coded to look under the built-in templates: https://github.com/appcelerator/alloy/blob/master/Alloy/commands/generate/generateUtils.js#L31 It would be a great feature request though (if not already present). Could you look that up and if needed create a ticket?
  4. Feon Sua Xin Miao 2016-01-07

    PR merged. Functional Test: 1. create a new controller alloy generate controller newcontrol 2. The first line of the new controller file should not be
     var args = arguments[0] || {}; 
  5. Eric Wieber 2016-01-20

    Verified fixed, using: MacOS 10.11.3 (15D21) Studio 4.4.0.201511241829 Ti SDK 5.2.0.v20160114021251 Appc NPM Appc CLI 5.2.0-232 Xcode 7.2 (7C68) Node v0.12.7 Java 1.7.0_80 Controller template now uses new wording and uses $.args instead of arguments[0].

JSON Source