mardi 17 février 2015

Is it possible to bind a parent component’s property, via template, to a child component computed property?

Is it possible to bind a parent component's property, via template, to a child component computed property?


The goal is to access the child component's computed property via binding.



// We are in some parent component's template
{{child-component aComputedProp=aNonComputedProp}}





// Parent component
export default Ember.Component.extend({
aNonComputedProp: null
});





// Child component
export default Ember.Component.extend({
aComputedProp: function () {
return 4 + 4;
}.property()
});




Aucun commentaire:

Enregistrer un commentaire