vendredi 22 mai 2015

Property in a component not propagating to the template

I'm building a component:

export default Ember.Component.extend({
tagName:'input',
classNameBindings: ['form-control','isMissing:input-warning',':form-control'],
isMissing: false,
attributeBindings: ['customType:type','customSize:size','value','disabled','placeholder'],
customType: "text",
customSize: "50",
valueBinding:'name',
disabled:'disabled',
placeholder:'placeholder',

focusIn:function(){
    this.sendAction('submit');
},
focusOut:function(){
    this.sendAction('cancel');
},

});

And what happens is that the binded attribute "value" (see line 5 of code, column 4) seems to get the value of 'name' whenever the propagation goes from the template to the component, but not the other way around.

Am I missing something? I read Ember docs on components and this attribute binding should propagate changes in the value of the property in both directions.

Is there an alternative way of binding this value?

Thanks!




Aucun commentaire:

Enregistrer un commentaire