Titanium JIRA Archive
Alloy (ALOY)

[ALOY-373] Create <Collection> in markup (singleton)

GitHub Issuen/a
TypeNew Feature
PriorityMedium
StatusResolved
ResolutionFixed
Resolution Date2012-11-13T17:21:26.000+0000
Affected Version/sn/a
Fix Version/sAlloy 0.3.3, 2012 Sprint 24
ComponentsXML
Labelsnotable
ReporterTony Lukasavage
AssigneeUnknown
Created2012-11-08T22:06:41.000+0000
Updated2018-03-07T22:26:13.000+0000

Description

Allow developers to create a singleton of collections in markup. This will make model-view binding even easier and more expressive. It is also even less code developers will need to achieve model-view binding.
<!-- to enforce readability, <Collection> MUST be a child of <Alloy> -->
<Alloy>
    <Collection src="myModel"/>
</Alloy>
where *myModel* refers to an Alloy model definition that you would find in *app/models*. A collection generated this way will be accessible anywhere in the application via the Alloy.Collections namespace. To access the above, you would do:
var singleton = Alloy.Collections.myModel;

Comments

  1. Tony Lukasavage 2012-11-13

    Resolving this issue with as singletons. Further work to make them instances will be documented in ALOY-379.

JSON Source