Titanium JIRA Archive
Alloy (ALOY)

[ALOY-1326] Paths and names of Collections/Images/Controllers is not consistent.

GitHub Issuen/a
TypeImprovement
Priorityn/a
StatusReopened
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
ComponentsModels, Runtime
Labelsalloy, collections, controllers, models
ReporterRene Pot
AssigneeFeon Sua Xin Miao
Created2015-06-02T12:57:59.000+0000
Updated2015-11-05T15:18:38.000+0000

Description

The name of the controller can also be a relative path. But to make it uniform (just like with images) you should be able to add a / in front of the name/path. It currently doesn't support that. This fix resolves that for controllers,models and collections, and adds to the documentation it can also be a relative path. An example why this should be supported is because it is consistent for everything. Image names/paths with a leading / on Android is even required, and a controller name/path with a leading / is generating errors. This leads to unexpected issues, and confusion. This fix makes it consistent:
Alloy.createController('name'); // will work
Alloy.createController('/path/to/controller'); // will also work
$.imageView.image = '/path/to/image.png' // will (only) work
Alloy.createCollection('name'); // will work
Alloy.createCollection('/path/to/collection'); // will work
Consistent behaviour across all names/paths leads to expected functionality. Exceptions make it confusion. This fixes that

Comments

  1. Rene Pot 2015-06-02

    I added a Pull Request to GitHub for this fix: https://github.com/appcelerator/alloy/pull/695
  2. Radamantis Torres-Lechuga 2015-06-26

    PR has been accepted
  3. Fokke Zandbergen 2015-11-05

    The PR still has to be merged, so reopening.

JSON Source