[ALOY-1021] Alloy: Add support for Alloy.CFG and Alloy.Globals in views
| GitHub Issue | n/a |
|---|---|
| Type | Improvement |
| Priority | Low |
| Status | Resolved |
| Resolution | Fixed |
| Resolution Date | 2015-05-26T07:21:47.000+0000 |
| Affected Version/s | Alloy 1.3.1 |
| Fix Version/s | Alloy 1.7.0 |
| Components | Styling |
| Labels | Alloy.CFG, Alloy.Globals, alloy, views |
| Reporter | Fokke Zandbergen |
| Assignee | Unknown |
| Created | 2014-05-10T18:29:24.000+0000 |
| Updated | 2018-03-07T22:25:39.000+0000 |
Description
As the attached sample app shows, you can not use
Alloy.CFG. and Alloy.Globals. in Alloy views. In the compiled code, they will end up as strings:
$.__views.__alloyId0 = Ti.UI.createLabel({
top: 50,
text: "Alloy.CFG.foo",
id: "__alloyId0"
});
I would like to see that just like Ti. the Alloy. namespace would be detected and used as variable instead of string.
Attachments
| File | Date | Size |
|---|---|---|
| al.zip | 2014-05-10T18:29:24.000+0000 | 8754 |
| iOS-simulatorschermafbeelding 10 mei 2014 14.22.27.png | 2014-05-10T18:39:10.000+0000 | 26954 |
Showing
Alloy.CFGandAlloy.Globalsnot working in the view, only in TSS.Moving this improvement request to engineering for further evaluation and prioritization.
+1 It would be great if this feature will be implemented!
+1
The related regexp to be changed: https://github.com/appcelerator/alloy/blob/master/Alloy/commands/compile/compilerUtils.js#L214
PR: https://github.com/appcelerator/alloy/pull/677
Please check this https://developer.appcelerator.com/question/182308/alloycfg-not-working-on-android-tss It seems Alloy.CFG only works with iOS in TSS but not on android.
PR merged.
Can somebody update docs at http://docs.appcelerator.com/platform/latest/#!/guide/Alloy_XML_Markup with changes related to this PR?
[~falko] created TIDOC-2299