lundi 23 février 2015

How to update Ember.binding from when bound property updates on component

I have a simple component that on init binds a custom computed (as the lookup is dynamic based on the index passed in)



export default Ember.Component.extend({
tagName: "span",
classNameBindings: ["visible"],
attributeBindings: ["className", "index", "field"],
visible: function() {
return; //apply some logic here
}.property("validationIndex"),
initialize: function() {
var field = this.get("field");
var index = this.get("index");
var validationIndex = "targetObject.%@1%@2Validation".fmt(field, index);
Ember.Binding.from(validationIndex).to("validationIndex").connect(this);
}.on("init")
});


The question is, when the each loop has an item removed (from the ArrayController essentially) .. how can I update the binding to reflect this new one?


Thank you in advance





Aucun commentaire:

Enregistrer un commentaire