[ALOY-808] Alloy: Can't use 'Alloy.CFG' in a model definition
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2014-11-26T22:41:42.000+0000 |
Affected Version/s | Alloy 1.2.0 |
Fix Version/s | Alloy 1.4.0 |
Components | n/a |
Labels | alloy, globals, model, qe-manualtest, scope |
Reporter | Daniel Sefton |
Assignee | Tony Lukasavage |
Created | 2013-08-02T08:15:08.000+0000 |
Updated | 2014-11-26T22:41:42.000+0000 |
Description
I want to useAlloy.CFG
in my model definition:
exports.definition = {
config: {
columns: { .. }
URL: Alloy.CFG.API + '/json/gettasks',
adapter: {
type: "restapi",
collection_name: "todo",
idAttribute: "id"
}
}
};
But I get:
[ERROR] [iphone, 6.1.3, 192.168.0.101]
Type: TypeError
Message: 'undefined' is not an object (evaluating 'Alloy.CFG')
File: /alloy/models/Todo.js
Line: 4
If I change it to require('alloy').CFG
all is OK, but that's just ugly ;)
Actually 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?
Attachments
File | Date | Size |
---|---|---|
app.zip | 2014-02-06T16:17:45.000+0000 | 5903996 |