Titanium JIRA Archive
Appcelerator Community (AC)

[AC-3430] Model-View binding is broken in 5.2.1

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionNeeds more info
Resolution Date2016-04-05T18:56:33.000+0000
Affected Version/sAppcelerator Studio 4.5.0
Fix Version/sn/a
ComponentsAlloy
Labelsn/a
ReporterMichael Bahl
AssigneeShak Hossain
Created2016-03-30T09:56:54.000+0000
Updated2016-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();
}

Comments

  1. Sharif AbuDarda 2016-03-30

    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

JSON Source