[ALOY-1487] Support using dashes and other special characters in XML element IDs
| GitHub Issue | n/a |
|---|---|
| Type | Improvement |
| Priority | None |
| Status | Open |
| Resolution | Unresolved |
| Affected Version/s | alloy 1.8.5 |
| Fix Version/s | n/a |
| Components | XML |
| Labels | n/a |
| Reporter | Fokke Zandbergen |
| Assignee | Bruce Wayne |
| Created | 2016-04-02T08:50:18.000+0000 |
| Updated | 2016-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.
No comments