As stated in the documentation, the controller should never call a method or change properties in the corresponding view, but instead, the view should bind the state of the controller associated with it.
Having this:
App.MyController = Ember.Controller.extend({ myViewVisible:false, toggleViewVisibitity:function(){ this.set('myViewVisible', !this.get('myViewVisible')); } } App.MyView = Ember.View.extend({ isVisible:function(){ return this.get('myViewVisible'); }.observes('myViewVisible') }
When I call toggleViewVisibility from another controller, nothing happens in the view.
How can I do it right?
Thank you in advance
source share