[ALOY-391] Create <Model> in markup (instance)
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Medium |
Status | Resolved |
Resolution | Fixed |
Resolution Date | 2012-11-29T23:21:21.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Alloy 0.3.3, 2012 Sprint 24 |
Components | XML |
Labels | n/a |
Reporter | Tony Lukasavage |
Assignee | Unknown |
Created | 2012-11-14T20:11:46.000+0000 |
Updated | 2018-03-07T22:25:57.000+0000 |
Description
The tag currently only creates/references a global singleton version of the collection. We need to implement such that instances bound to the current controller can be created as well.
would be made available in Alloy.Models, an instance model will be attached to the current controller just as a UI component. So the above instance model would be accessible in controller code like this:
Proposed Syntax
Singleton
<!-- "src" is the Alloy Model on which the model is based -->
<Model src="myModel"/>
Instance
<!-- "src" is the Alloy Model on which the model is based -->
<!-- adding an "id" will implicitly make this an instance -->
<!-- "instance" can explicitly make the collection an instance -->
<Model id="someId" src="myModel" instance="true"/>
While a singleton
var modelInstance = $.someId;
No comments