{ "id": "131810", "key": "ALOY-1087", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "11113", "key": "ALOY", "name": "Alloy", "projectCategory": { "id": "10400", "description": "Tools for developing applications", "name": "Tooling" } }, "fixVersions": [], "resolution": null, "resolutiondate": null, "created": "2014-06-17T08:46:28.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "baseContro", "widgets" ], "versions": [], "issuelinks": [], "assignee": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "updated": "2016-12-08T14:21:51.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "12333", "name": "Widgets" } ], "description": "When you try to define a baseController for a widget controller:\r\n\r\n{code:javascript}\r\nexports.baseController = 'foo';\r\n{code}\r\n\r\nThe compiled widget controller will have:\r\n\r\n{code:javascript}\r\nrequire(\"alloy/controllers/foo').apply(this, Array.prototype.slice.call(arguments));\r\n{code}\r\n\r\nUsing {{WPATH('foo')}} will only make things worse and result in a path like {{alloy/controllers/my.widget/foo}}.\r\n\r\nRelated code:\r\n\r\n- https://github.com/appcelerator/alloy/blob/6e5496c545d67a4fe60bd967bda55a06d5807611/Alloy/template/component.js#L18\r\n- https://github.com/appcelerator/alloy/blob/624da7094296bdabd5b9e53201948d6f3dac782d/Alloy/commands/compile/index.js#L584\r\n\r\nMaybe at the lines mentioned second we can prefix either {{alloy/controllers}} or {{widgetDir}}?\r\n\r\n{code:javascript}\r\n\ttemplate.parentController = (cCode.parentControllerName !== '') ?\r\n\t\t(cCode.parentControllerName : \"'BaseController'\";\r\n{code}", "attachment": [], "flagged": false, "summary": "baseController in widgets should look for local controller", "creator": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "subtasks": [], "reporter": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "environment": "Alloy 1.4.0.RC", "comment": { "comments": [ { "id": "314189", "author": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "body": "Original Reporter: [~fokke]", "updateAuthor": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "created": "2014-07-15T16:58:48.000+0000", "updated": "2014-07-15T16:58:48.000+0000" }, { "id": "331378", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "The workaround is to use a relative path:\r\n\r\n{code}\r\nexports.baseController = '../widgets/theWidgetYouWantToExtend/controllers/widget';\r\n{code}", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2014-11-10T15:31:45.000+0000", "updated": "2014-11-10T15:31:45.000+0000" }, { "id": "402984", "author": { "name": "darknos", "key": "darknos", "displayName": "Sergey Nosenko", "active": true, "timeZone": "Europe/Helsinki" }, "body": "the workaround doesn't work with Android SDK 6.0.0 :(\r\n\r\nI have to use\r\n{code}require(\"./field\").apply($, Array.prototype.slice.call(arguments));{code}\r\nin my controllers.", "updateAuthor": { "name": "darknos", "key": "darknos", "displayName": "Sergey Nosenko", "active": true, "timeZone": "Europe/Helsinki" }, "created": "2016-12-08T13:29:51.000+0000", "updated": "2016-12-08T14:21:51.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }