Titanium JIRA Archive
Alloy (ALOY)

[ALOY-1316] Support use of $.args.* in any XML attribute or TSS property

GitHub Issuen/a
TypeNew Feature
PriorityNone
StatusClosed
ResolutionFixed
Resolution Date2019-06-21T21:56:44.000+0000
Affected Version/sn/a
Fix Version/sCLI Release 7.1.0, Alloy 1.14.0
ComponentsXML
Labelsn/a
ReporterFokke Zandbergen
AssigneeFeon Sua Xin Miao
Created2015-10-09T11:54:36.000+0000
Updated2019-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.

Comments

  1. Feon Sua Xin Miao 2018-03-08

    PR: https://github.com/appcelerator/alloy/pull/885
  2. Ewan Harris 2019-06-06

    Reopening as this was resolved incorrectly
  3. Lokesh Choudhary 2019-06-21

    Verified the fix in CLI core 7.1.0-master.22. Closing.

JSON Source