How to get the parentView of the modal in the controller. Can we do this?


#1

App.ApplicationRoute = Ember.Route.extend({ actions: { openModal: function(modalName, model) {

     this.controllerFor(modalName).set('model', model);
  return this.render(modalName, {
    into: 'application',
    outlet: 'modal'
  });
},

closeModal: function(modalName, model) {
  this.disconnectOutlet({
    outlet: 'modal',
    parentView: 'application'
  });
}

} });

I want to get the parentView of the modal. Can I do this?


#2

reaching around to your parent view is 99% of the time very much discouraged, I suspect you may want to rethink the problem so you dont need to.