i have just started learning ember 1 week ago, and i'm little confused about data-biding :
- i have
indexcontroller that have afoorproperty, test-componentthat have a itsbarproperty comming from the index controllerfooproperty
index
index.hbs // template
parent value :
index.js // controller
import Ember from 'ember';
export default Ember.Controller.extend({
foo: "",
});
test-component // template
child value
test-component // component
import Ember from 'ember';
let TestComponent = Ember.Component.extend({
});
TestComponent.reopenClass({
positionalParams: ['bar'],
});
export default TestComponent;
what confuse is :
-
if write the component in my index template as , i get only one-way data-binding, that mean if i change the
barproperty in the component, thefooproperty don't change. -
if i use a inside my component, i can see that both
barandfooget updated, so bar is binded to both foo and input value component ?? how its is working(PS : as i said in question 1, foo get updated only if i write in my index template
and thanks everyone.
Aucun commentaire:
Enregistrer un commentaire