{ "id": "117918", "key": "ALOY-808", "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": [ { "id": "15758", "description": "Alloy 1.4.0", "name": "Alloy 1.4.0", "archived": false, "released": true, "releaseDate": "2014-07-17" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2014-11-26T22:41:42.000+0000", "created": "2013-08-02T08:15:08.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "alloy", "globals", "model", "qe-manualtest", "scope" ], "versions": [ { "id": "15402", "description": "Alloy 1.2.0, concurrent with SDK 3.1.0", "name": "Alloy 1.2.0", "archived": false, "released": true, "releaseDate": "2013-08-15" } ], "issuelinks": [], "assignee": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2014-11-26T22:41:42.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [], "description": "I want to use {{Alloy.CFG}} in my model definition:\r\n\r\n{code:javascript}\r\nexports.definition = {\r\n config: {\r\n columns: { .. }\r\n URL: Alloy.CFG.API + '/json/gettasks',\r\n adapter: {\r\n type: \"restapi\",\r\n collection_name: \"todo\",\r\n idAttribute: \"id\"\r\n }\r\n }\r\n};\r\n{code}\r\n\r\nBut I get:\r\n\r\n{code}\r\n[ERROR] [iphone, 6.1.3, 192.168.0.101] \r\nType: TypeError\r\nMessage: 'undefined' is not an object (evaluating 'Alloy.CFG')\r\nFile: /alloy/models/Todo.js\r\nLine: 4\r\n{code}\r\n\r\nIf I change it to {{require('alloy').CFG}} all is OK, but that's just ugly ;)\r\n\r\nActually I wonder why this doesn't work, since {{Alloy}} should be available as a global, but I guess it's solved easily by just moving the line following the {{exports.definition}} object, where {{var Alloy}} is defined, to the top of the generated file?", "attachment": [ { "id": "45656", "filename": "app.zip", "author": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "created": "2014-02-06T16:17:45.000+0000", "size": 5903996, "mimeType": "application/zip" } ], "flagged": false, "summary": "Alloy: Can't use 'Alloy.CFG' in a model definition", "creator": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "subtasks": [], "reporter": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Alloy 1.2.0-alpha\r\nSDK 3.1.1.GA\r\niOS Simulator 6.1", "comment": { "comments": [ { "id": "291556", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR: https://github.com/appcelerator/alloy/pull/330", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-02-05T23:39:31.000+0000", "updated": "2014-02-05T23:39:31.000+0000" }, { "id": "291635", "author": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "body": "Functional test:\r\n\r\n1. Create a new Alloy project\r\n2. Overwrite the app folder in your project with the contents of the attached file.\r\n3. Build using the PR-version of Alloy\r\n4. You should get a simple tableview with a few names listed, no error messages.", "updateAuthor": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "created": "2014-02-06T16:17:45.000+0000", "updated": "2014-02-06T16:17:45.000+0000" }, { "id": "304331", "author": { "name": "pmishra", "key": "pmishra", "displayName": "Paras Mishra", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Tested as directed by [~skypanther], a tableview with a few names is displayed with no error messages.\r\nVerified the fix using the following environment:\r\nDevice : iPhone 5s , iOS version : 7.1\r\nSDK: 3.3.0.v20140508135704\r\nCLI version : 3.3.0-dev\r\nOS : MAC OSX 10.9.2\r\nAlloy: 1.4.0-dev\r\nACS: 1.0.14\r\nnpm:1.3.2\r\nLiveView: 1.0.4\r\nAppcelerator Studio, build: 3.3.0.201405080918\r\ntitanium-code-processor: 1.1.1\r\nXCode : 5.1.1", "updateAuthor": { "name": "pmishra", "key": "pmishra", "displayName": "Paras Mishra", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2014-05-12T08:27:37.000+0000", "updated": "2014-05-12T08:27:37.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }