[AC-3430] Model-View binding is broken in 5.2.1
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | n/a |
| Status | Closed |
| Resolution | Needs more info |
| Resolution Date | 2016-04-05T18:56:33.000+0000 |
| Affected Version/s | Appcelerator Studio 4.5.0 |
| Fix Version/s | n/a |
| Components | Alloy |
| Labels | n/a |
| Reporter | Michael Bahl |
| Assignee | Shak Hossain |
| Created | 2016-03-30T09:56:54.000+0000 |
| Updated | 2016-04-05T18:56:33.000+0000 |
Description
Model-View Databinding changed from 5.2.0 to 5.2.1
<Alloy>
<Model src="contact" id="contact" instance="true" />
<Window>
<Label text="$.contact.name" />
</Window>
</Alloy>
*Derived file:*
+In 5.2.0+
$.__alloyId5.text = _.isFunction($.contact.transform) ? $.contact.transform()["name"] : _.template("<%=contact.name%>", {
contact: $.contact.toJSON()
});
+In 5.2.1+ ({color:red}{$.{color} got not translared to <%=)
$.__alloyId407.text = _.isFunction($.contact.transform) ? $.contact.transform()["name"] : _.template("{$.contact.name}", {
contact: $.contact.toJSON()
});
Now the underscore _.template function would never work so it ist required to implement a transform function in all collections
transform: function(){
return this.toJSON();
}
Hello, I am not completely understanding your issue. Could you explain a little more what you are trying to do. Please share full reproducible code about the issue that you are having. Also, Please provide a complete list of steps to follow for me to reproduce the issue in my environment. Regards, Sharif