I’m trying to get used to use computed properties as observers but I’m getting one deprecation that is very confusing to me. This is the scenario ( http://emberjs.jsbin.com/huhowe/edit?html,js,console,output ):
I have a controller, a component and another component inside the previous one. When a button is clicked in the controller, a property is set to true and this ‘travel’ all the way down to the inner component. Then, the component detect it using a computed property as an observer and send up an action to notify the controller that now it can hide the components (by setting to false a property areComponentsVisible).
There are two things that I don’t understand:
- the computed property that I’m using as observer (detectChangeOnButtonClicked) doesn’t react if it isn’t written in the template of the inner component
- when I click the button in the controller, the action sended from the inner controller modify the areComponentsVisible property twice in a single render, as a deprecation message informs me.
Do you have any idea about why this is happening?