[ALOY-1316] Support use of $.args.* in any XML attribute or TSS property
| GitHub Issue | n/a |
|---|---|
| Type | New Feature |
| Priority | None |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2019-06-21T21:56:44.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | CLI Release 7.1.0, Alloy 1.14.0 |
| Components | XML |
| Labels | n/a |
| Reporter | Fokke Zandbergen |
| Assignee | Feon Sua Xin Miao |
| Created | 2015-10-09T11:54:36.000+0000 |
| Updated | 2019-06-21T21:56:44.000+0000 |
Description
We now support using
$.args in XML if=$.args.foo attributes. However, it would be very useful if you could use it as value of any attribute, as well as value in TSS.
The following should then result in a Window containing a label that says _bar_:
*index.xml*
<Alloy>
<Window class="container">
<Require src="foo" foo="bar" />
</Window>
</Alloy>
*foo.xml*
<Alloy>
<Label text="$.args.foo" />
</Alloy>
Currently this compiles to:
$.__views.foo = Ti.UI.createLabel({
text: "$.args.foo",
id: "foo"
});
If you try to use $.args.foo in TSS it will fail to compile with:
[ERROR] Expected "Alloy", "L", "Ti", "Titanium", "WPATH", "[", "false", "null", "true", "undefined", "{", comment, end of line, number, string or whitespace but "$" found.
PR: https://github.com/appcelerator/alloy/pull/885
Reopening as this was resolved incorrectly
Verified the fix in CLI core 7.1.0-master.22. Closing.