Ember.js pre4, how to do the previous pre2 connectOutlet stuff

旧城冷巷雨未停 提交于 2019-12-04 07:23:22
TommyKey

If you just need to add your view into the app you can use my solution in this question:

What's the right way to enter and exit modal states with Ember router v2?

But if you need to add it too an outlet, you can do it by sending an event to the router and just render it in the event without transitioning it to another route.

events: {
    showModal: function(){
        this.render('modal', {into: 'index', outlet: 'modalOutlet', controller = this.controllerFor('modal')}); 
    }
}

See fiddle for an example:

http://jsfiddle.net/Energiz0r/gChWa/1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!