[ALOY-1326] Paths and names of Collections/Images/Controllers is not consistent.
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | n/a |
Status | Reopened |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Models, Runtime |
Labels | alloy, collections, controllers, models |
Reporter | Rene Pot |
Assignee | Feon Sua Xin Miao |
Created | 2015-06-02T12:57:59.000+0000 |
Updated | 2015-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
I added a Pull Request to GitHub for this fix: https://github.com/appcelerator/alloy/pull/695
PR has been accepted
The PR still has to be merged, so reopening.