In pre2, suppose I had this application code outside the router:
var controller = App.MyController.create(); controller.content = [...]; App.get('router').get('applicationController').connectOutlet({ outletName: 'modal', controller: controller, viewClass: App.MyView, context: controller });
That is, I am filling out the issue with the name “modal”, added to the “application” template, with my data.
Now, in pre4, I have no reference to the controllers created by the router. How can you fill the outlet outside the router?
I could ask the router about the transition, but I do not want to change the URL, because I just open the modal content with the current content.
EDIT:
This is what I came up with to fix temp by looking at the application view from the App.Router.router object .. obviously this is a dirty hack, does anyone know the best and correct way to do this in pre4?
var controller = App.MyController.create(); controller.content = this.get('content'); var theView = App.MyView.create(); theView.set('controller', controller); App.Router.router.currentHandlerInfos[0].handler.router._activeViews.application[0].connectOutlet('modal', theView);
source share