Titanium JIRA Archive
Alloy (ALOY)

[ALOY-1487] Support using dashes and other special characters in XML element IDs

GitHub Issuen/a
TypeImprovement
PriorityNone
StatusOpen
ResolutionUnresolved
Affected Version/salloy 1.8.5
Fix Version/sn/a
ComponentsXML
Labelsn/a
ReporterFokke Zandbergen
AssigneeBruce Wayne
Created2016-04-02T08:50:18.000+0000
Updated2016-04-02T08:52:26.000+0000

Description

I'd like to be able to use dashes (and other special characters) in IDs for XML elements:
<Alloy>
  <Label id="my-label" />
</Alloy>
Which currently compiles to this syntax error:
    $.__views.my - label = Ti.UI.createLabel({
        id: "my-label"
    });
Which should become:
    $.__views["my-label"] = Ti.UI.createLabel({
        id: "my-label"
    });
Notes: * Generated code for adding child views, event listeners and so on should also use the bracket notation for these type of IDs. * Probably it's best to always use this notation and let Uglify optimise where possible. * Special characters in classes already work fine.

Comments

No comments

JSON Source